...
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.
0 0 votes
Article Rating
Subscribe
Notify of
0 Comments
Inline Feedbacks
View all comments
0
Would love your thoughts, please comment.x
()
x
error: Alert: Content selection is disabled!!