Which code fragment prints red: blue: small: medium?

Given the code fragment:

Which code fragment prints red: blue: small: medium?

A. Option A
B. Option B
C. Option C
D. Option D

Download Printable PDF. VALID exam to help you PASS.

One thought on “Which code fragment prints red: blue: small: medium?

  1. D
    public static void main(String[] args) {
    String[][] shirts = new String[2][2];
    shirts[0][0]=”red”;
    shirts[0][1]=”blue”;
    shirts[1][0]=”small”;
    shirts[1][1]=”medium”;
    for(int index = 0;index<2;){
    for(int idx=0;idx<2;){
    System.out.print(shirts[index][idx]+":");
    idx++;
    }
    index++;
    }
    }

Leave a Reply

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


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