aspose file tools*
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes Generics: how to read 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 "Generics: how to read " Watch "Generics: how to read " New topic
Author

Generics: how to read

Anthony Karta
Ranch Hand

Joined: Aug 09, 2004
Posts: 342
I look at the Collections.java source and found this method header:


how to understand/read the return part


in plain english

thanks


SCJP 5
Barry Gaunt
Ranch Hand

Joined: Aug 03, 2002
Posts: 7729
There is no return part - the method is returning void. The input list is sorted in place.

The <T extends Comparable<? super T>> is the condition on the parameter type of the list to be sorted: List<T>

I read it as "The input parameter is a list of objects of type T such that T must be comparable with an object of the same type or comparable to a superclass of the same type T".
[ July 21, 2006: Message edited by: Barry Gaunt ]

Ask a Meaningful Question and HowToAskQuestionsOnJavaRanch
Getting someone to think and try something out is much more useful than just telling them the answer.
 
Don't get me started about those stupid light bulbs.
 
subject: Generics: how to read