Skip to content

JAVA + SQL ยท PRACTICE WITH EXPLANATIONS

Explain the answer. Then test the idea.

Use these 15 quick checks to find a topic worth revisiting. Choose an answer, read the explanation, then open the related lesson and run its example.

This is a learning exercise. Answers stay on this page and are not saved as an assessment record.

A useful way to practise

Explain why the correct option works and why another option fails. Change one input and predict its effect before running the code. If you only remember the option, return to the worked example.

Explore longer workbook tasks โ†’

Java foundations

Java control flow: validate, filter and count marks

Which marks pass the stated rule?

Java interfaces: swap a formatter without changing the caller

Why can show accept both greeting implementations?

Java encapsulation: protect a wallet balance

After wallet.spend(-10) fails, what should happen to its balance?

Java List, Set and Map: choose the right collection

What does putting a second value under the same Map key do?

Java Iterator: remove matching elements safely

When is iterator.remove valid for this iterator?

Java exception handling: recover from one invalid input

Does Integer.parseInt("150") prove that 150 is a valid mark out of 100?

SQL reasoning