Azienda coinvolta
What is the difference between an abstract class and an interface in Java?
Anonimo
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.