It's not a secret anymore!
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes enthuware error? Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login
JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Reply Bookmark "enthuware error?" Watch "enthuware error?" New topic
Author

enthuware error?

Vishwanath Krishnamurthi
Ranch Hand

Joined: Jun 04, 2007
Posts: 331
Hi,

Q.No 23 of Test6 in enthuware, (its a DnD so, I couldn't copy and paste it here..)

gives an explanation like this regarding the natural ordering for strings:

3. Collections.sort(collection) method sorts the elements of the given collection in the natural order of it elements. Natural order means: as governed by the compareTo() method of the elements. I case of String elements, the natural order is: space < lower case < upper case. Here, the output is expected to be in reverse order, therefore, we need a reverse order Comparator. Collections.reverseOrder() returns such a comparator.


and the answer for the question too was based on this..

But isn't it:
space < upper case < lower case ?

Thanks,
Vishwa.
[ January 20, 2008: Message edited by: Vishwanath Murthi ]

Blog
Burkhard Hassel
Ranch Hand

Joined: Aug 25, 2006
Posts: 1274
Howdy Vishwa,

you are right.

prints
[ , A, a]


Yours,
Bu.


all events occur in real time
Burkhard Hassel
Ranch Hand

Joined: Aug 25, 2006
Posts: 1274
...
But you are not right in calling it "errata".
Know why?
Vishwanath Krishnamurthi
Ranch Hand

Joined: Jun 04, 2007
Posts: 331
Oh! Its an "error"
Paul Anilprem
Enthuware Software Support
Ranch Hand

Joined: Sep 23, 2000
Posts: 2912
Hi Vishwanath,
Thanks for pointing it out. The order is indeed space < upper case < lower case, but the given answer is correct and will remain same (in this particular situation).


Enthuware - Best Mock Exams and Questions for Oracle/Sun Java Certifications
Quality Guaranteed - Pass or Full Refund!
Vishwanath Krishnamurthi
Ranch Hand

Joined: Jun 04, 2007
Posts: 331
Hi Paul,

The question says,

Complete the Code so that it will print [amy, Adam, audrey] when run.

and (the completed code, the answer given)...



gives an O/P: [audrey, amy, Adam] (as expected) and not [amy, Adam, audrey]...
[ January 20, 2008: Message edited by: Vishwanath Murthi ]
Paul Anilprem
Enthuware Software Support
Ranch Hand

Joined: Sep 23, 2000
Posts: 2912
Vishwanath,
That's because you aren't using the same code as given in the question. What you have written is but the code in question is
HTH,
Paul.
Vishwanath Krishnamurthi
Ranch Hand

Joined: Jun 04, 2007
Posts: 331
Thanks..
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: enthuware error?
 
Similar Threads
Output for Arrays.binarySearch()
TreeSet
another question from scjptest.com
comparator-someone answer this
Natural order in collections