4 ms·
> To avoid redundant code and more re-usability, Oracle Corp is going to introduce private methods in Java 9 Interfaces. From Java 9 onwards, you can write priv
by kodfodrasz 10y ago
> To avoid redundant code and more re-usability, Oracle Corp is going to introduce private methods in Java 9 Interfaces. From Java 9 onwards, you can write private and private static methods too in an interface using ‘private’ keyword.
To me this seems sane only to be used with the `default` keyword. Am I right, or did I miss something?
The last time I used Java the Optional waas mostly usable, but had some rought edges, and I saw that all my painful usecases were waiting to be released in Java 9. When I last checked unfortunately the monadic types were still not sharing an interface for common operations (Optional and Stream), not even in Java9.
Overall: finally it is here! I miss some parts now from the .Net Core world.
- aardvark179 10y agoYes, private on interfaces is there to make using default easier.