• Post Reply Bookmark Topic Watch Topic
  • New Topic

Generics  RSS feed

 
Ranch Hand
Posts: 41
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I got the idea of imposing a constraint on linkedlist.Is the following statement legal,

LinkedList<String> list = new LinkedList<String>();
Y am I getting "(" or "[" expected error
 
Ranch Hand
Posts: 7729
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You are using Java 5.0, right?
 
this is supposed to be a surprise, but it smells like a 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!