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.

Leave a Reply

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