The explanation contains the following:
2. Although the map part is not required because Item class overrides the toString method to print the name anyway, it is valid.
Actually it does not override toString so the map part is actually needed!
About Question enthuware.ocpjp.v8.2.1762 :
Moderators: Site Manager, fjwalraven
-
- Posts: 32
- Joined: Tue Oct 06, 2015 9:06 am
- Contact:
-
- Site Admin
- Posts: 10389
- Joined: Fri Sep 10, 2010 9:26 pm
- Contact:
Re: About Question enthuware.ocpjp.v8.2.1762 :
You are right. Fixed.
thank you for your feedback!
Paul.
thank you for your feedback!
Paul.
-
- Posts: 49
- Joined: Mon Jul 27, 2015 4:34 am
- Contact:
Re: About Question enthuware.ocpjp.v8.2.1762 :
One more thing, option one is not comparing for id attribute and is not syntactically correct:
you're trying to compare a String and a primitive integer.
Id should be String too for this to work, or it should be an Integer to be able to use compareTo() method to compare two ids
Code: Select all
.sorted((a, b)->a.getName().compareTo(b.getId()))
Id should be String too for this to work, or it should be an Integer to be able to use compareTo() method to compare two ids
-
- Site Admin
- Posts: 10389
- Joined: Fri Sep 10, 2010 9:26 pm
- Contact:
Re: About Question enthuware.ocpjp.v8.2.1762 :
Fixed.
thank you for your feedback!
thank you for your feedback!
Who is online
Users browsing this forum: No registered users and 2 guests