Search the courses, subjects, tracks, games and features, or jump straight to a page.
3 cards from this section. Quick, good the night before a test.
What is inheritance in Java?
Think about code reuse.
Write the syntax to define a subclass Dog that inherits from Animal.
Use the `extends` keyword.
What keyword is used to create a subclass in Java?
It is not simply 'extend'!
An interface can contain concrete methods. True or False?
Think about what an interface is meant to enforce.
Write a Java program to demonstrate single inheritance, where a superclass has a method and the subclass overrides it.
Remember to use 'extends' while declaring the subclass.
Create a scenario where multiple classes implement a single interface and call their methods. Describe the output.
Focus on how each class follows the interface contract.
5 more questions in this section. Enroll free to practise them all.
Enroll free