Question d’entretien chez Agoda

Java: abstract vs interface

Réponse à la question d'entretien

Utilisateur anonyme

9 janv. 2018

both cannot be instantiated and must be extended however while abstract class may include fully implemented methods an interface cannot have implementations - only declarations. a class with at least one abstract method must be declared as abstract. interfaces do not use the abstract modifier as all method declarations are must be implemented by overriding class