Skip to content

Commit

Permalink
Collections tests added.
Browse files Browse the repository at this point in the history
  • Loading branch information
Umit-Soylu committed Sep 20, 2020
1 parent a7c0d8c commit b7adff4
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 13 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,4 +31,4 @@ Following issues are introduced step by step at each commit. Please use the link
- List concept and its application classes are in the [Arrays & Lists Package](/src/com/bilgeadam/java/tutorials/collections/arrays_lists/). (Test classes are under [here](/test/com/bilgeadam/java/tutorials/collections/arrays_lists/)) (New keywords: `Array`, `List`, `LinkedList` and `ArrayList`)
- Queue concept and its application classes are in the [Queues Package](/src/com/bilgeadam/java/tutorials/collections/queues/). (Test classes are under [here](/test/com/bilgeadam/java/tutorials/collections/queues/)) (New keywords: `Queue`, `ArrayQueue`, `PriorityQueue` and `Stack`)
- Set concept and its application classes are in the [Sets Package](/src/com/bilgeadam/java/tutorials/collections/sets/). (Test classes are under [here](/test/com/bilgeadam/java/tutorials/collections/sets/)) (New keywords: `Set`, `HashSet`, and `TreeSet`)

- Collections real world example cases can be found [here](/src/com/bilgeadam/java/examples/).
Original file line number Diff line number Diff line change
Expand Up @@ -89,18 +89,13 @@ private String consumeBucket(Stack<String> currentStack){
* @return the result
*/
private float parseSimpleExpression(float operandOne, float operandTwo, char operator){
switch (operator){
case '+':
return operandOne + operandTwo;
case '-':
return operandOne - operandTwo;
case '*':
return operandOne * operandTwo;
case '/':
return operandOne / operandTwo;
default:
throw new IllegalArgumentException("Unknown symbol: " + operator);
}
return switch (operator) {
case '+' -> operandOne + operandTwo;
case '-' -> operandOne - operandTwo;
case '*' -> operandOne * operandTwo;
case '/' -> operandOne / operandTwo;
default -> throw new IllegalArgumentException("Unknown symbol: " + operator);
};
}
/**
* This method verifies given string is a {@link Double} number or not
Expand Down

0 comments on commit b7adff4

Please sign in to comment.