Multiple choice general knowledge science & technology

Which of the following is not a keyword or reserved word in Java?

  1. if

  2. then

  3. else

  4. for

  5. while

Reveal answer Fill a bubble to check yourself
B Correct answer
Explanation

In Java, 'if', 'else', 'for', and 'while' are reserved keywords used for control flow statements. The word 'then' is NOT a keyword in Java - Java uses if-else statements without requiring 'then' (unlike some other languages). The 'then' keyword is used in languages like Pascal or Visual Basic but not in Java syntax.