Pregunta de entrevista de Tata Consultancy Services

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

Respuesta de la entrevista

Anónimo

4 de dic de 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.