This week's book giveaway is in the Beginning Java forum.
We're giving away four copies of Murach's Java Programming and have Joel Murach on-line!
See this thread for details.
Win a copy of Murach's Java Programming this week in the Beginning Java forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Generic Collections  RSS feed

 
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
Sheriff
Posts: 23260
124
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 .
 
Today you are you, that is turer than true. There is no one alive who is youer than you! - Seuss. Tiny ad:
Thoughts on deprecation in Java
https://coderanch.com/t/683016/java/Deprecation-Java
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!