wood burning stoves 2.0*
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes Comparator as argument? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Bookmark "Comparator as argument?" Watch "Comparator as argument?" New topic
Author

Comparator as argument?

Sandeep Chhabra
Ranch Hand

Joined: Aug 28, 2005
Posts: 340
Hi,
Can anyone please answer :
Which of the following may take a Comparato as argument to control softing order?

A Collections.sort() method
B Collection.sort() method
C The TreeSet constructor
D Arrays.sort() method

I think the answer is A, C and D.


Regards<br />Sandy<br />[SCJP 5.0 - 75%]<br />[SCWCD 1.4 - 85%]<br />------------------<br />Tiger, Tiger burning bright,<br />Like a geek who works all night,<br />What new-fangled bit or byte,<br />Could ease the hacker's weary plight?
marc weber
Sheriff

Joined: Aug 31, 2004
Posts: 11343

Originally posted by Sandeep Chhabra:
... Can anyone please answer...

http://java.sun.com/j2se/1.4.2/docs/api/


"We're kind of on the level of crossword puzzle writers... And no one ever goes to them and gives them an award." ~Joe Strummer
sscce.org
Sandeep Chhabra
Ranch Hand

Joined: Aug 28, 2005
Posts: 340
Thanks for the reply marc
But I have already referred to the API. and I found that
Collections.sort() method
TreeSet Constructor
Arrays.sort() method

all of them can take the comparator.

But this question is from whizlabs. and It doesnt agree's with me
According to them Arrays.sort cannot take comparator as an argument.
This is the reason that I wanted to confirm.
marc weber
Sheriff

Joined: Aug 31, 2004
Posts: 11343

Originally posted by Sandeep Chhabra:
...this question is from whizlabs. and It doesnt agree's with me
According to them Arrays.sort cannot take comparator as an argument.
This is the reason that I wanted to confirm.

Oh, I see. Whizlabs is wrong...
Sandeep Chhabra
Ranch Hand

Joined: Aug 28, 2005
Posts: 340
Thanks Marc
Sara Olsen
Ranch Hand

Joined: Oct 12, 2005
Posts: 59
Sandy,

Did you find many bugs in Whizlabs?
Thinking of bying it...
Sandeep Chhabra
Ranch Hand

Joined: Aug 28, 2005
Posts: 340
Originally posted by Sara Olsen:
Sandy,

Did you find many bugs in Whizlabs?
Thinking of bying it...


Wait for a day more Sara, Dont be in a hurry.
Tomorrow I am going to post A REAL LOOOOOOOOOOOOOOOOOOOOOOONGGGGGGGGG LIST of bugs in whizlabs simulator...
I was shocked to find so many bugs.
Jesus Angeles
Ranch Hand

Joined: Feb 26, 2005
Posts: 2049
it helps to try out at least one simulation software, to get a feel of the exam. i think there some free ones, so i didnt need to buy any. and also, scjp is an exam with the most free mock exams on the web. you will have more than enough without buying any.
Sara Olsen
Ranch Hand

Joined: Oct 12, 2005
Posts: 59
Originally posted by Jesus Angeles:
scjp is an exam with the most free mock exams on the web. you will have more than enough without buying any.


There are NOT many mock exams for SCJP 5! I know there are lots for 1.4 version, but they are not enough for this one
marc weber
Sheriff

Joined: Aug 31, 2004
Posts: 11343

It's worth noting that this Arrays.sort method is NOT new with Java 5.0. If it were, then we might conclude that the mock exam is specific to 1.4. But in this case, it appears to be a genuine error.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Comparator as argument?
 
Similar Threads
question about Math class
string quest
kb Q19 page 283
Dan's exam question
Dan's - Math.abs Question..