Computer Applications
Which of the following is mandatory in the switch statement?
- break
- continue
- case
- default
Java Conditional Stmts
11 Likes
Answer
case
Reason — The keyword 'case' is mandatory in the switch statement.
Answered By
6 Likes
Related Questions
If a = 8 and b = 4, the value of
a % = bis- 2
- 0
- 4
- 8
Predict the output of the following code snippet:
int a = 1; int b = 2; if (a == b) System.out.println("Both values are equal"); else System.out.println("Values are not equal");- Both values are equal
- Incorrect use of the == operator
- Values are not equal
- No output
Which of the following is not a valid method of the Scanner class?
- next( )
- nextInt( )
- nextLong( )
- nextNumber( )
What will be the output of
Math.floor(-20.10);?- -20.0
- -21.0
- 20
- 21