Wednesday, July 19, 2017

Difference between Abstract and interface class



Abstract
Interface
Multiple class inheritance not possible
Multiple class inheritance possible
Abstract class can have instance variable
Interface only have  constant but not instance variable
Abstract class contain constructor
Interface class doesn’t  contain constructor
Abstract class can declare following modifiers public ,static or final. It’s contain access modifiers.
We can’t declare interface  following modifiers private, protected or final ,static. It’s by default public.
Inside a Abstract class we can declare static block
Inside a interface class we can’t declare static block
We can declare variable.
We can’t declare variable.

No comments:

Post a Comment