What is the difference between an abstract class and an interface in Java?
Updated 2026-07-10 · Beginner friendly
Quick answer
An abstract class can have constructors, fields, and both finished and unfinished methods, and a class can extend only one. An interface defines a contract, can have default and static methods since Java 8, cannot hold instance state, and a class can implement many. Use an abstract class for a shared base, and an interface for a capability shared across unrelated classes.
Key differences
- Inheritance: one abstract class can be extended, many interfaces can be implemented.
- State: abstract classes hold instance fields, interfaces hold constants only.
- Constructors: abstract classes have them, interfaces do not.
- Methods: since Java 8 interfaces can have default and static method bodies.
interface Flyer {
default void takeOff() { System.out.println("lifting off"); }
}
abstract class Bird {
abstract void sing();
}
In the interview
Mention that Java 8 default methods blurred the line, but the big rule remains: you can implement many interfaces but extend only one class. Use interfaces to model capabilities and abstract classes to share base behaviour.
Common follow up questions
Related interview questions
Want the full Java guide?
Read every Java concept with notes, diagrams, and code in one place. Track your progress as you go.
Open the Java guide All Java questions