Must-do problems: Polymorphism
140 min · Beginner
Need help? Ask a tutor on WhatsApp (opens in a new tab)Every problem here asks you to design a small class family where one call does different work for different objects. Read the input into a parent-type variable or array, let each child override only what differs, write @Override on every override, and run every test before opening a hint.
What you will learn
- Design a parent class whose methods each child overrides with its own rule
- Keep shared steps in a parent method that calls overridable methods
- Extend a parent rule with super.method() through a chain
- Combine overloading and overriding in one class family
Sign in to continue this lesson
Create an account to read every lesson, practise with the exercises and keep track of your progress.