Chapter 3Using Operators and Decision Constructs
THE OCA EXAM TOPICS COVERED IN THIS PRACTICE TEST INCLUDE THE FOLLOWING:
- Using Operators and Decision Constructs
- Use Java operators; use parentheses to override operator precedence
- Test equality between Strings and other objects using == and equals()
- Create if and if/else and ternary constructs
- Use a switch statement
-
Which of the following variable types is not permitted in a switch statement?
- String
- double
- int
- char
-
What is the value of tip after executing the following code snippet?
int meal = 5;
int tip = 2;
int total = meal + (meal>6 ? ++tip : ‐‐tip);
- 1
- 2
- 3
- 6
-
What is the ...
Get OCA / OCP Java SE 8 Programmer Practice Tests now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.