Class PrivateInterfaceMethodsDemo

java.lang.Object
modernfeatures.java9.PrivateInterfaceMethodsDemo

public class PrivateInterfaceMethodsDemo extends Object
Demonstrates the use of private and private static methods in interfaces (Java 9+).

Private methods in interfaces allow code reuse and organization within default and static methods, without exposing helper logic to implementers or users of the interface.

  • Constructor Details

    • PrivateInterfaceMethodsDemo

      public PrivateInterfaceMethodsDemo()
  • Method Details

    • main

      public static void main(String[] args)