• Post Reply Bookmark Topic Watch Topic
  • New Topic

Generic Collections  RSS feed

 
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
 
author
Sheriff
Posts: 23329
125
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 .
 
Skool. Stay in. Smartness. Tiny ad:
The WEB SERVICES and JAX-RS Course
https://coderanch.com/t/690789/WEB-SERVICES-JAX-RS
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!