Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Generics: how to read

 
Anthony Karta
Ranch Hand
Posts: 342
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I look at the Collections.java source and found this method header:


how to understand/read the return part


in plain english

thanks
 
Barry Gaunt
Ranch Hand
Posts: 7729
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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 ]
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic