Java 9 – Private Interface Methods

What is it?

  • Private method in interface with implementation.
  • Private method can be used within default or static methods within interface. Learn about Default Methods in interface

Example:

Output:

 

Leave a Reply

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