Domanda di colloquio di LBi Software

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

Risposta di colloquio

Anonimo

12 apr 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.