Abstract Vs Interface

Abstract Class

  1. It can have abstract and non-abstract methods.
  2. Doesn't support multiple inheritance.
  3. It can have final, non-final, static and non-static variables.
  4. Provide the implementation of interface.
  5. The abstract keyword is used to declare abstract class.
  6. An abstract class can extend another Java class and implement multiple Java interfaces.
  7. It can be extended using keyword "extends".
  8. It can have class members like private, protected, etc.

Example :
public abstract class Shape
{
    public abstract void draw();
}

Interface


  1. It can have only abstract methods. 
  2. Supports multiple inheritance.
  3. It has only static and final variables.
  4. Can't provide the implementation of abstract class.
  5. The interface keyword is used to declare interface.
  6. It can extend another Java interface only.
  7. It can be implemented using keyword "implements".
  8. Members of a Java interface are public by default.

Example :
public interface Draw
{
    void draw();
}