Correct Answer - Option 4 : There is syntax error in line no. 6
The correct answer is “option 4”.
EXPLANATION:
Option 1: FALSE
“While” is not a keyword, hence it is valid to use it as a class name.
Option 2: FALSE
Since Option 1 is false, so this option is by default false.
Option 3: FALSE
Any string operation can contain an equation type of expression.
So, this is not any kind of syntax error.
Option 4: TRUE
Java uses condition as Boolean expressions like:
while(true) or while(false)
Hence, while(1) is the wrong syntax for java.
while(1) will give compiler time error as it treats as type mismatch to convert from integer to boolean value.
Hence, the correct answer is “option 4”.