• 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: 22124
88
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