Java Interview Question

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

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.

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