Differences between abstract class and interface in Java
One of the most frequently asked questions on Java job interview: " What the difference between abstract class and interface in Java? " And in this post I will try to answer that question. The differences are following: The number of extendings . An abstract class can extend only one typical Java class or one abstract class at a time. But an interface can extend any number of interfaces at a time. What can extend . An abstract class can extend concrete (regular) class or abstract class. But interface can extend another interface only. Keyword "abstract" for methods . Keyword "abstract" is mandatory for declaring a method as an abstract in abstract class. But in interface that keyword is optional, because methods abstract here by default. Access modifiers for methods . An abstract class can have protected and public abstract methods. But interface can have public abstract methods only. Variables . An abstract class can have static, final or static f...