This week's giveaway is in the Spring forum.
We're giving away four copies of REST with Spring (video course) and have Eugen Paraschiv on-line!
See this thread for details.
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 REST with Spring (video course) this week in the Spring forum!
JavaRanch » Java Forums » Java » Java in General
Bookmark "collections" Watch "collections" New topic


Santosh Kumar Nayak
Ranch Hand

Joined: Aug 02, 2011
Posts: 141
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: 15042

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

Java Beginners FAQ - JavaRanch SCJP FAQ - The Java Tutorial - Java SE 8 API documentation
Tony Docherty

Joined: Aug 07, 2007
Posts: 2771
That use of an upper bounded wildcard is actually pointless as the String class is final and so there are no subclasses of String.
I agree. Here's the link:
subject: collections
It's not a secret anymore!