DIFFERENCE BETWEEN ABSTRACT CLASS AND INTERFACE IN JAVA

Royce Roy

Total Post:149

Points:1043
Posted by  Royce Roy
 793  View(s)
Ratings:
Rate this:
What is the difference between abstract classes and interfaces in java,both look very similar to me
  1. Mayank Tripathi

    Post:397

    Points:3117
    Re: Difference between Abstract class and interface in java

    Abstract classes:
    1)An abstract class can have method body (non-abstract methods).
    2)An abstract class can have instance variables. .
    3)An abstract class can have constructor.
    4)An abstract class can have static methods.
    5)You can extends one abstract class.

    Interfaces
    1)Interface have only abstract methods.
    2)An interface cannot have instance variables
    3)Interface cannot have constructor.
    4)Interface cannot have static methods.
    5)You can implement multiple interfaces.

Answer

NEWSLETTER

Enter your email address here always to be updated. We promise not to spam!