...
OOPS
August 25, 2024
OOPS
August 25, 2024
OOPS
August 25, 2024
OOPS
August 25, 2024

OOPS

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?
A
There is a syntax error in line -1
B
There are syntax errors in,line -1 and line -6
C
There is a syntax error in line -6
D
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.

Leave a Reply

Your email address will not be published. Required fields are marked *