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 object-oriented programming?
Think of it as a child receiving traits from a parent.
What is an interface?
It’s like a contract for a class.
What type of inheritance allows a subclass to inherit from one superclass?
Consider the basic structure of class hierarchies.
True or False: An interface can contain concrete methods.
Think about what a class is required to do when it implements an interface.
Design a Java class structure using inheritance to represent shapes. Include at least one subclass for a geometric shape and demonstrate method overriding.
Think about how different shapes will have different ways to calculate their area, and implement that in code.
Implement multiple interfaces in a Java class. Create interfaces for 'Draw' and 'Paint', and have a class 'Art' that implements both.
Consider how a single class can adopt behaviors from multiple interfaces.
6 more questions in this section. Enroll free to practise them all.
Enroll free