← All topics
Quiz: Java Control Flow: questions with answers
10 questions, each with the answer and a short explanation.
Take the timed quiz + get a certificate →- Q1. What does this print? (code)
- Q2. How many times does a do-while loop run if the condition is false at the start?
- Q3. What does this print? (code)
- Q4. What does this print? (code)
- Q5. Which operator is the ternary operator?
- Q6. What does this print? (code)
- Q7. After int n = sc.nextInt(); the user typed 25 and pressed Enter. What does the next sc.nextLine() return?
- Q8. What does this print? (code)
- Q9. What does this print? (code)
- Q10. What happens with int x = 3; if (x = 5) { ... } in Java?