Q: A SWITCH case statement in Java is a ___ control statement.
Solution: no solution
Q: Which is the alternative to SWITCH in Java language?
Solution: We can implement a SWITCH statement using IF, ELSE IF and ELSE control statements.
Q: What are the keywords used to implement a SWITCH case in Java language?
Solution: no solution
Q: What are the parts of a SWITCH in java?
Solution: no solution
Q: A SWITCH statement accepts ___ type of data as input.
Solution: no solution
Q: A switch statement in Java accepts ___ as input data.
Solution: SWITCH does not support long constants.
Q: Choose the correct syntax of SWITCH statement in Java below.
Solution: The semicolon (;) after SWITCH {} is not required. So option A is wrong though it compiles fine.
Q: Which version of Java did start supporting String as the input data type of a SWITCH?
Solution: no solution
Q: What is the output of Java program with SWITCH below? int a=10; switch(a) { case 10: System.out.println("TEN"); }
Solution: "break;" is optional.
Q: What is the output of the Java program below? int b=20; switch(b) { default: System.out.println("LION"); }
Solution: DEFAULT statement alone can be written without any error.
You Have Score    | /10 |