What's the difference between an Abstract Class and Interface in Java ?

Posted by  Sanat Shukla
 355  View(s)
Ratings:
Rate this:

What's the difference between an Abstract Class and Interface in Java?

  1. Re: What's the difference between an Abstract Class and Interface in Java ?

    That is the basic difference between an abstract class and interface is that an interface can only possess a declaration of public static methods with no concrete implementation. While an abstract class may have members with any access specifiers (public, private, etc.) with or without a concrete implementation.

    A primary difference is the use of abstract classes and interfaces is that a class which implements an interface must implement all the methods of the interface while a class which inherits from an abstract class doesn't require the implementation of all the methods of its superclass.

    The class can implement multiple interfaces but it can extend only one abstract class.

Answer