aspose file tools*
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes Doubt in K&B SCJP 6: topic Sorting with the Arrays Class Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Bookmark "Doubt in K&B SCJP 6: topic Sorting with the Arrays Class" Watch "Doubt in K&B SCJP 6: topic Sorting with the Arrays Class" New topic
Author

Doubt in K&B SCJP 6: topic Sorting with the Arrays Class

Gabriel Moreno
Greenhorn

Joined: Aug 14, 2008
Posts: 5
On top of page 576 of K&B SCJP 6 it says that the Arrays.sort() method is overriden in the same way Collections.sort() method is.

What? Arrays and Collections extend from Object class. Object class doesn't have a sort() method, so... Where is the override? Which method did Arrays.sort() or Collections.sort() overrode? I just don't see how those two methods are overriden in any way. What am I missing here?

My guess is that is a edition mistake, please any comment on the topic would be greatly appreciated. I have been pondering this for days.
M Srilatha
Ranch Hand

Joined: Aug 27, 2008
Posts: 137
HI,

I guess it should be:
"the Arrays.sort() method is overloaded in the same way Collections.sort() method is."

I donot have SCJP6 book.But in SCJP 5, after this stmt two forms of sort method are given. So i think it should be overloaded instead of overridden.


Thanks,<br />Srilatha M
Gabriel Moreno
Greenhorn

Joined: Aug 14, 2008
Posts: 5
Is not overloaded because right after the two forms of sort() being given it says:

In addition, the Arrays.sort() method is overloaded about a million times to provide a couple of sort methods for every type of primitive.

So, it doesn't make any sense to have overloaded as a statement first and then say "in addition is overloaded"
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Doubt in K&B SCJP 6: topic Sorting with the Arrays Class