permaculture playing cards*
The moose likes Java in General and the fly likes collections 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 » Java » Java in General
Bookmark "collections" Watch "collections" New topic
Author

collections

Santosh Kumar Nayak
Ranch Hand

Joined: Aug 02, 2011
Posts: 93
What is the meaning of the Collection<? extends String> my_plan

Can some one explain me the above syntax.
Jesper de Jong
Java Cowboy
Saloon Keeper

Joined: Aug 16, 2005
Posts: 14114
    
  16

That's generics with wildcards. See this tutorial: Generics - Wildcards.


Java Beginners FAQ - JavaRanch SCJP FAQ - The Java Tutorial - Java SE 7 API documentation
Scala Notes - My blog about Scala
Tony Docherty
Bartender

Joined: Aug 07, 2007
Posts: 2249
    
  47
That use of an upper bounded wildcard is actually pointless as the String class is final and so there are no subclasses of String.
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: collections