Enrol to start learning
Reading is open to everyone. Enrolling is free, and it is what unlocks the audio lessons, practice tests and progress tracking.
11.6. Interface vs Abstract Class
This section
Practice test
11 questions on this section. Wrong answers show you what to read again.
Sign up to take itWhole chapter
Revision test
Mixed questions from across the chapter. Your answers get marked.
Sign up to take itQuick
Flashcard drill
3 cards from this lesson. Good the night before a test.
Try these first
- 1.
Define what an interface is.
Hint
Remember, it’s about enforcing certain behaviors.
- 2.
Can an abstract class contain concrete methods?
Hint
Think about shared behavior between classes.
- 3.
What can an abstract class contain?
- Only abstract methods
- Both abstract and concrete methods
- Only concrete methods
Hint
Think of concrete methods as those that have their implementation!
- 4.
Is it possible for a class to implement multiple interfaces?
- True
- False
Hint
Think of different roles a class might play.
- 5.
Design a simple Java application using both an interface and an abstract class. Explain your design decisions.
Hint
Consider what common traits animals share.
- 6.
Explain a scenario where using an interface is more beneficial than using an abstract class, including an example.
Hint
Think about flexibility and what interface allows.
Exercises
Total Questions
2
Estimated Time
4 min
Passing Score
70%
Instructions
- Read each question carefully
- You can use hints if you need help
- Complete all questions before submitting
4 more questions available
Enrol freeQuiz
Total Questions
2
Estimated Time
4 min
Passing Score
70%
Instructions
- Read each question carefully
- You can use hints if you need help
- Complete all questions before submitting
1 more question available
Enrol freeChallenge Problems
Total Questions
2
Estimated Time
4 min
Passing Score
70%
Instructions
- Read each question carefully
- You can use hints if you need help
- Complete all questions before submitting