Page 1 of 1

About Question enthuware.ocpjp.v8.2.1762 :

Posted: Tue Oct 06, 2015 9:14 am
by Martyjee
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!

Re: About Question enthuware.ocpjp.v8.2.1762 :

Posted: Tue Oct 06, 2015 9:32 am
by admin
You are right. Fixed.
thank you for your feedback!
Paul.

Re: About Question enthuware.ocpjp.v8.2.1762 :

Posted: Sat Oct 17, 2015 11:58 am
by mrmuiz
One more thing, option one is not comparing for id attribute and is not syntactically correct:

Code: Select all

.sorted((a, b)->a.getName().compareTo(b.getId()))
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

Re: About Question enthuware.ocpjp.v8.2.1762 :

Posted: Sat Oct 17, 2015 9:55 pm
by admin
Fixed.
thank you for your feedback!