Question 21
Given the code fragment: Which modification enables the code fragment to print TrueDone?
- Replace line 5 With String opt = "true"; Replace line 7 with case "true":
- Replace line 5 with boolean opt = l; Replace line 7 with case 1:
- At line 9, remove the break statement.
- Remove the default section.
Question 22
Given the following main method: What is the result?
- 5 4 3 2 1 0
- 5 4 3 2 1
- 4 2 1
- 5
- Nothing is printed
Question 23
Given the code fragment: What is the result?
- 100
- 101
- 102
- 103
- Compilation fails
Question 24
Given the code fragment: What is the result?
- Sum is 600
- Compilation fails at line n1.
- Compilation fails at line n2.
- A ClassCastException is thrown at line n1.
- A ClassCastException is thrown at line n2.
Question 25
Given the code fragment: Which two modifications, when made independently, enable the code to print joe:true: 100.0? (Choose two.)
- Option A
- Option B
- Option C
- Option D
- Option E