Private interface method

In JAVA9, where you can write an interface method for performing body in two ways.
1. Method default
format: public default return value of the method name () {}
2. Method static
format: public static method return value name () {}

Private method:
When we write more default methods or static methods in an interface where you may encounter
program duplication. We can extract these repeated procedures, create a new method,
modified with private, so it created a private method can be called only interfaces.

Private method Format:
Default Private Method: When the procedure is repeated a plurality of default method used when the
format: private method return value name () {}
static private method: When the static method procedure is repeated a plurality of times using
the format: private static method return value name(){}

Guess you like

Origin blog.csdn.net/chen404897439/article/details/91410793