Consider the following Java code segment:

public class while /*line1*/

{

public void loop()

{

int x=0;

while(true) /*line 6*/

{

System.out.println(“x plus one is” + (x + 1));

}

}

}

Which of the following is true?

1
There is a syntax error in line -1
2
There are syntax errors in, line -1 and line -6
3
There is a syntax error in line -6
4
No syntax error

Sponsored

hivanix.in

Visit

This quiz is brought to you by hivanix.in

🌐 Web App Development

Quick Navigation