Java
Programming and Technical
Programming
Technical
public class While
{
public void loop()
{
int x= 0;
while ( 1 ) /* Line 6 */
{
System.out.print("x plus one is " + (x + 1)); /* Line 8 */
}
}
}
public class While
{
public void loop()
{
int x= 0;
while ( 1 ) /* Line 6 */
{
System.out.print("x plus one is " + (x + 1)); /* Line 8 */
}
}
}
Which statement is true?
A. There is a syntax error on line 1.
B. There are syntax errors on lines 1 and 6.
C. There are syntax errors on lines 1, 6, and 8.
D. There is a syntax error on line 6.
Read Solution (Total 5)
-
- Compilation error at line no 6
while does not accept any integer value it just takes input as boolean value
i.e true or false - 7 years agoHelpfull: Yes(3) No(1)
- error in line 6
- 9 years agoHelpfull: Yes(2) No(1)
- line 6
- 8 years agoHelpfull: Yes(1) No(1)
- a there is syntax error at line1
- 5 years agoHelpfull: Yes(1) No(1)
- C. There is a syntax error on line 6.
- 3 years agoHelpfull: Yes(0) No(0)
Java Other Question