This week's book giveaway is in the OCMJEA forum.
We're giving away four copies of OCM Java EE 6 Enterprise Architect Exam Guide and have Paul Allen & Joseph Bambara 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 OCM Java EE 6 Enterprise Architect Exam Guide this week in the OCMJEA forum!
JavaRanch » Java Forums » This Site » Cattle Drive
Bookmark "Why Generics and not Watch "Why Generics and not New topic
Author

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]http://www.dbws.net/[/url] - Check out Grails Forum
Mike Simmons
Ranch Hand

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