adplus-dvertising
frame-decoration

Question

What is the output of the below Java code?
boolean[] ary = {true, false, true, true};
for(int i=0; i<ary.length; i++)
{
 System.out.print(ary[i] +",");
}

a.

true,true,true,true,

b.

true,false,false,true

c.

true,false,true,true

d.

Compiler error

Posted under Java Programming

Answer: (c).true,false,true,true

Engage with the Community - Add Your Comment

Confused About the Answer? Ask for Details Here.

Know the Explanation? Add it Here.

Q. What is the output of the below Java code?