Oracle
1Z0-808 · Question #28
1Z0-808 Question #28: Real Exam Question with Answer & Explanation
Sign in or unlock 1Z0-808 to reveal the answer and full explanation for question #28. The question stem and answer options stay visible for context.
Using Operators and Decision Constructs
Question
Given the code fragment:
public class Test {
public static void main(String[] args) { //line n1
Switch (X) {
case 1:
System.out.println("One");
break;
Case 2:
System.out.println("Two");
break;
}
}
}
Which three code fragments can be independently inserted at line n1 to enable the code to print one?Options
- AByte x = 1;
- Bshort x = 1;
- CString x = "1";
- DLong x = 1;
- EDouble x = 1;
- FInteger x = new Integer("1");
Unlock 1Z0-808 to see the answer
You've previewed enough free 1Z0-808 questions. Unlock 1Z0-808 for full answers, explanations, the timed quiz mode, progress tracking, and the master PDF. Question stem and options stay visible so you can still see what's on the exam.
Topics
#switch statements#auto-boxing/unboxing#type compatibility#primitive vs wrapper types