Sunday, 1 November 2015

difference between interface and abstract class.

Difference between interface and abstract class

Interface provide pure abstract methods.
Abstract class provide concrete classes.

Interface provide multiple inheritance.
Abstract class don't provide multiple inheritance.

We cannot create object of interface, we create only reference variable of interface.
We create object of abstract class.

We cannot define data field within interface.
In abstract class we have to define data field. 

We cannot use any access specifier within interface.
We can use access specifier with abstract class.

No comments:

Post a Comment