This week's book giveaway is in the OCAJP forum.
We're giving away four copies of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) and have Khalid A Mughal & Rolf W Rasmussen on-line!
See this thread for details.
Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Generic Collections

 
vendikonda sravan
Ranch Hand
Posts: 38
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Marshal
Pie
Posts: 21362
84
C++ Chrome Eclipse IDE Firefox Browser Java jQuery Linux VI Editor Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

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
 
vendikonda sravan
Ranch Hand
Posts: 38
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
thanks for the replay but it yes was some syntactical compilation error as you said have corrected it & it works .
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic