How many times is 2 printed as a part of the output? 05/21/2017 – by Mod_GuideK 1 Given: How many times is 2 printed as a part of the output? A. Zero B. Once C. Twice D. Thrice E. Compilation fails. SHOW ANSWERSCorrect Answer: A Explanation/Reference: Download Printable PDF. VALID exam to help you PASS.
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 4 Reply
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