Must-do problems: References, Casting and Immutability
120 min · Intermediate
Need help? Ask a tutor on WhatsApp (opens in a new tab)Every problem here turns one idea of this module into a working program: a pattern instead of a blind cast, an object that can never change, a record that checks itself, or a nested class in the right place. Read the input with Scanner, keep classes small, and run every test before opening a hint.
What you will learn
- Reach child-only members safely with instanceof patterns
- Design immutable classes and records that validate once and never leak
- Use immutability to keep versions and undo cheaply
- Choose between static nested and inner classes in real designs
Sign in to continue this lesson
Create an account to read every lesson, practise with the exercises and keep track of your progress.