This week's book giveaway is in the Big Data forum.
We're giving away four copies of Elasticsearch in Action and have Radu Gheorghe & Matthew Lee Hinman on-line!
See this thread for details.
The moose likes Cattle Drive and the fly likes Why Generics and not 'Specifics' Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Elasticsearch in Action this week in the Big Data forum!
JavaRanch » Java Forums » This Site » Cattle Drive
Bookmark "Why Generics and not Watch "Why Generics and not New topic

Why Generics and not 'Specifics'

Dave Brown
Ranch Hand

Joined: Mar 08, 2005
Posts: 301
Probably missing something really obvious here but with the introduction of Generics the compiler can see a collection is intended to hold a Specific object.. not a Generic object..

List<String> is 'Specific'ally a list of Strings.. but List on its own is a generic list... can hold any object....

It seems backwards to me, but as I said I'm sure I'm missing something obivous !!

Regards, Dave Brown
SCJP 6 - [url][/url] - Check out Grails Forum
Mike Simmons
Ranch Hand

Joined: Mar 05, 2008
Posts: 3019
I talked about this a bit just the other day in my third post here.
I agree. Here's the link:
subject: Why Generics and not 'Specifics'