Which modification enables the code fragment to print TrueDone?

Given the code fragment:

Which modification enables the code fragment to print TrueDone?
A. Replace line 5 With String result = "true"; Replace line 7 with case "true":
B. Replace line 5 with boolean opt = l; Replace line 7 with case 1=
C. At line 9, remove the break statement.
D. Remove the default section.

Download Printable PDF. VALID exam to help you PASS.

3 thoughts on “Which modification enables the code fragment to print TrueDone?

  1. A
    public static void main(String[] args) {
    // boolean opt= true;
    //A
    String result=”true”;
    switch (result){
    case “true”:
    System.out.println(“True”);
    break;
    default:
    System.out.println(“******”);
    }
    System.out.println(“Done”);
    }

Leave a Reply

Your email address will not be published. Required fields are marked *


The reCAPTCHA verification period has expired. Please reload the page.