Question
In Java, which comparison about Interface vs Abstract Class is accurate?
- There is no practical difference in behavior, performance, or API design when Interface vs Abstract Class is involved.
- The oldest option related to Interface vs Abstract Class is always the right production choice regardless of context.
- Choose an interface for flexible contracts and multiple implementations, and an abstract class for controlled reuse of common behavior or state.
- Differences around Interface vs Abstract Class are mostly cosmetic, so correctness and maintainability do not change.
Hint
Focus on the behavior or tradeoff, not just the keyword.
Answer and rationale
Correct answer: C. Choose an interface for flexible contracts and multiple implementations, and an abstract class for controlled reuse of common behavior or state.
Choose an interface for flexible contracts and multiple implementations, and an abstract class for controlled reuse of common behavior or state. This is the comparison that usually separates memorization from understanding.
Track: Java