Pergunta de entrevista da empresa LBi Software

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

Resposta da entrevista

Sigiloso

12 de abr. de 2019

There are 3 main differences, 1. An abstract class can't ever be instantiated, while an interface may be anonymoulsy instantiated. 2. Attributes in an abstract class can be non-final while attributes in an interface are final by default. 3. Methods from an abstract class may have a default behavior, while methods in an interface are implicitly abstract and may not have a default behavior.