Java 8 - Interface with default method VS Abstract Class

Interface with default method:
* Every variable is public static final. whether we are decalaring or not. Not possible to declare instance variable.
* Never talks about state of object.
* We can't declare constructor
* We can't declare instance and static block
* Functional interface with default methods can be refered lambda expression.
* Inside interface we can't override object methods.

Abstract Class:
* We can declare instance variable.
* It can talks about state of object.
* We can declare Constructor.
* We can declare instance and static block
* Abstract class cant refer lambda expression.
* Inside Abstract class we can override object methods.

Comments

Popular posts from this blog

How to set Java Object into JaxBElement ?

GitLab