Difference between Abstract class and interface in java

What is the difference between abstract classes and interfaces in java,both look very similar to me
Last updated:4/15/2015 12:43:46 AM

1 Answers

Mayank Tripathi
Mayank Tripathi

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