How many times is 2 printed as a part of the output?

Given:


How many times is 2 printed as a part of the output?
A. Zero
B. Once
C. Twice
D. Thrice
E. Compilation fails.

Download Printable PDF. VALID exam to help you PASS.

One thought on “How many times is 2 printed as a part of the output?

  1. public class dcdc {

    public static void main(String[] args) {

    String []table= {“aa”,”bb”,”cc”};
    for(String ss:table)
    {
    int ii=0;
    while(ii<table.length) {
    System.out.println(ss+","+ii);
    ii++;
    }
    }
    }
    }

    /////////////////////////////////
    aa,0
    aa,1
    aa,2
    bb,0
    bb,1
    bb,2
    cc,0
    cc,1
    cc,2

Leave a Reply

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


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