Pergunta de entrevista da empresa Tata Consultancy Services

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

Resposta da entrevista

Sigiloso

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