Difference between Abstract class and Interface in Java

Difference between Abstract Class and Interface are as follows:

Abstract Class:

  • Abstract classes have a default constructor and it is called whenever the concrete subclass is instantiated.
  • Contains Abstract methods as well as Non-Abstract methods.
  • The class which extends the Abstract class shouldn’t require implementing all the methods, only Abstract methods need to be implemented in the concrete sub-class.
  • Abstract Class contains instance variables.

Interface: 

  • Doesn’t have any constructor and couldn’t be instantiated.
  • Abstract method alone should be declared.
  • Classes which implement the interface should provide the implementation for all the methods.
  • The interface contains only constants.

Top 50+ Java Interview Questions with Answers

We covered nearly 50 + primary Java interview questions in this tutorial for fresh and experienced candidates.  Q.1- What is… Read More

4 years ago