Frage im Vorstellungsgespräch bei Tata Consultancy Services

What is the difference between an abstract class and an interface in Java?

Antwort im Vorstellungsgespräch

Anonym

4. Dez. 2025

Abstract Class • Can have both abstract & non-abstract methods. • Can have constructors. • Supports single inheritance only. • Can have variables with any access modifier. • Interface • By default all methods are abstract (until Java 8). • No constructors. • Supports multiple inheritance. • Variables are public, static, and final by default.