PRACTICE / UNDERSTAND / REPEAT

Java: Control flow

Practice control flow with self-contained questions. Check your answer, then use the explanation to understand the reasoning.

15 questionsAnswers explainedFree · no login
Question 1 of 15
Control flow · MCQQuestion link ↗

Does Java permit an int directly as the condition of an if statement?

Choose one answer
Answer & explanation

Answer: No; the condition must be boolean-compatible

Java does not use C-style numeric truthiness for conditions.