Page 1 of 1

[HD Pg 246, Sec. 9.2.4 - methods-in-an-interface]

Posted: Wed Apr 17, 2019 7:38 am
by flex567
I am not sure if I understand what this means:
Although not relevant to the OCA 8 exam, you should be aware about a serious issue with default and static methods in Java 8. If a method gets too big or if there multiple methods with a lot of common code, there is no way to refactor them into smaller methods without exposing all of them to the world because everything in an interface has to be public. Java 9 fixes this problem by allowing private methods in an interface.

Re: [HD Pg 246, Sec. 9.2.4 - methods-in-an-interface]

Posted: Wed Apr 17, 2019 7:55 am
by admin