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.
[HD Pg 246, Sec. 9.2.4 - methods-in-an-interface]
Moderator: admin
-
- Posts: 202
- Joined: Mon Apr 02, 2018 8:40 am
- Contact:
[HD Pg 246, Sec. 9.2.4 - methods-in-an-interface]
I am not sure if I understand what this means:
-
- Site Admin
- Posts: 10046
- Joined: Fri Sep 10, 2010 9:26 pm
- Contact:
Re: [HD Pg 246, Sec. 9.2.4 - methods-in-an-interface]
If you like our products and services, please help us by posting your review here.
Who is online
Users browsing this forum: No registered users and 87 guests