Can we provide implementation of a method in a Java Interface?

Before Java 8, it was not allowed to provide implementation of a method in an Interface.

Java 8 has introduced the flexibility of providing implementation of a method in an interface. There are two options for that:

  • Default Method: We can give default implementation of a method.
  • Static Method: We can create a static method in an interface and provide implementation.
Read the full book at www.amazon.com
Posted in Java 8, Java 8 Interview Questions

Leave a Reply

Your email address will not be published. Required fields are marked *

*