OOPS
August 25, 2024OOPS
August 25, 2024OOPS
Question 130 |
Consider the following Java code segment:
Public class while /*line1*/
{
Public void loop()
{
int x=0;
while(1) /*line 6*/
{
system.out.println(“x plus one is”+(x+1));
}
}
}
Which of the following is true?
Public class while /*line1*/
{
Public void loop()
{
int x=0;
while(1) /*line 6*/
{
system.out.println(“x plus one is”+(x+1));
}
}
}
Which of the following is true?
There is a syntax error in line -1
| |
There are syntax errors in,line -1 and line -6 | |
There is a syntax error in line -6 | |
No syntax error |
Question 130 Explanation:
We can’t used the keyword “while” as class name.So it will give syntax error.
Correct Answer: A
Question 130 Explanation:
We can’t used the keyword “while” as class name.So it will give syntax error.