OOPs HandbookAbstract Classes vs Interfaces, Default Methods & Marker Interfaces
ArchitectureIntermediate
9 min read

Abstract Classes vs Interfaces, Default Methods & Marker Interfaces

Designing polymorphic contracts, multiple inheritance of type, and tagging interfaces.

TM
TestMeMan SDE Curriculum
Updated Sept 2026
Verified for FAANG Interviews
FROM TESTMEMAN•TestMeMan

Mock tests for SSC, Banking, Railways, UPSC & state exams

Real exam pattern, negative marking and a worked solution for every question.

Sponsored Publisher Placement•
ID: ad-top-leaderboard
Executive Summary

Designing clean software architectures requires knowing when to use an Abstract Class and when to use an Interface.

1. Characteristics of an Abstract Class#

From PDF Page 8, Question 22: The 5 core characteristics of an abstract class are:

1. Instantiation of an abstract class is not allowed. It must be inherited.

2. An abstract class can have both abstract and non-abstract (concrete) methods.

3. An abstract class must declare at least one abstract method.

4. It is always public in interface contracts.

5. Can have instance variables, static variables, and constructors.

2. Abstract Class vs Interface Face-Off#

Tricky Question 12: Comparing the two core abstraction tools:

FeatureInterfaceAbstract Class
Multiple InheritanceSupports multiple inheritance of type (implements A, B)Single inheritance only (extends A)
Method ImplementationsPrimarily abstract; can have default and static methodsCan contain both abstract and fully implemented concrete methods
State & FieldsCannot store state; only public static final constantsCan maintain mutable instance variables and constructors
SpeedSlightly slower due to search in interface tableFast direct vtable resolution
Sponsored ContentTestMeMan

Practise placement aptitude on the real test pattern

TCS NQT, Infosys, Wipro, Accenture and Cognizant style mocks with section-wise analysis.

3. Default Methods in Interfaces & Marker Interfaces#

• Default Method (Tricky Question 27): Introduced in Java 8 to allow adding new methods to interfaces without breaking existing implementing classes.

• Marker Interface (Tricky Question 21): An empty interface containing no methods or fields (e.g., `java.io.Serializable`, `Cloneable`). It marks a class for special runtime or JVM handling.

Test Your Concept Mastery

Verify your retention on: Abstract Classes vs Interfaces, Default Methods & Marker Interfaces

Diagnostic Check
Question 1 of 1
What is a marker interface in Java?
Ready for a full proctored assessment?

Take a free quick test on the real exam pattern, with a worked solution for every question.

Launch Mock Test