Wipro Interview Question

Q: Can you explain the difference between an abstract class and an interface in Java, and when would you use each?

Interview Answer

Anonymous

Jun 14, 2025

An abstract class in Java is a class that may contain both abstract methods (without a body) and concrete methods (with a body). It is used when classes share a common base and some common functionality. An interface is a completely abstract type used to define a contract. It can only contain abstract methods (prior to Java 8), but since Java 8+, it can also have default and static methods.