This week's giveaway is in the EJB and other Java EE Technologies forum.
We're giving away four copies of EJB 3 in Action and have Debu Panda, Reza Rahman, Ryan Cuprak, and Michael Remijan on-line!
See this thread for details.
The moose likes Beginning Java and the fly likes Generic Collections Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Generic Collections" Watch "Generic Collections" New topic
Author

Generic Collections

vendikonda sravan
Ranch Hand

Joined: May 09, 2010
Posts: 38
i didn't get why the line below is not leagal

"List<Animal>animals=new ArrayList<Animal>(); "
can anyone help me understand that

thanks
Henry Wong
author
Sheriff

Joined: Sep 28, 2004
Posts: 18101
    
  39


I am assuming that you are concluding that the line is not legal due to a compile error? Can you show us what the error is?

Henry


Books: Java Threads, 3rd Edition, Jini in a Nutshell, and Java Gems (contributor)
vendikonda sravan
Ranch Hand

Joined: May 09, 2010
Posts: 38
thanks for the replay but it yes was some syntactical compilation error as you said have corrected it & it works .
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Generic Collections
 
Similar Threads
Top ten guy movies (comedy)
generics extends question?
Why do I rcv a ClassCastException?
type of relationship - IS -A or HAS-A
WA #1.....word association