JDK 8 Features
JDK 8 Features
default method
We can write 'default' method in interface without forcing their implemented class.
We can enhance functionality of interface without any trouble or affect of their implemented
class no need to write forcefully implemented of 'default' method of interface.
If implemented class is not satisfied with interface 'default' method implementation then
implemented class can rewrite there own implemented.
All interface of Collection framework mostly use this feature so that Lambda Expression we
can use with Collection Framework.
static method
The main purpose of this feature is to provide utility method inside in interface instead of
utility class. It is a better approach for developer.
Without learning extra class which is utility class, we can use utility method for our purpose
from interface.
Interface 'static' method we can not call implemented class object. We can call by using
interface name.
'static' method of interface can not be override in their implemented class.