About Question enthuware.ocpjp.v8.2.1762 :

All the posts and topics that contain only an error report will be moved here after the error is corrected. This is to ensure that when users view a question in ETS Viewer, the "Discuss" button will not indicate the presence of a discussion that adds no value to the question.

Moderators: Site Manager, fjwalraven

Post Reply
Martyjee
Posts: 32
Joined: Tue Oct 06, 2015 9:06 am
Contact:

About Question enthuware.ocpjp.v8.2.1762 :

Post 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!

admin
Site Admin
Posts: 10389
Joined: Fri Sep 10, 2010 9:26 pm
Contact:

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

Post by admin »

You are right. Fixed.
thank you for your feedback!
Paul.

mrmuiz
Posts: 49
Joined: Mon Jul 27, 2015 4:34 am
Contact:

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

Post 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

admin
Site Admin
Posts: 10389
Joined: Fri Sep 10, 2010 9:26 pm
Contact:

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

Post by admin »

Fixed.
thank you for your feedback!

Post Reply

Who is online

Users browsing this forum: No registered users and 7 guests