adplus-dvertising
frame-decoration

Question

What is the output of the below Java program with FOR loop?
for(int j=0; j<5;j++;)
  System.out.print(j + ",");

a.

1,2,3,4,

b.

0,1,2,3,4

c.

Compiler error

d.

None of the above

Posted under Java Programming

Answer: (c).Compiler error

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 program with FOR loop?