This week's book giveaway is in the JDBC forum.
We're giving away four copies of Make it so: Java DB Connections & Transactions and have Marcho Behler on-line!
See this thread for details.
The moose likes Beginning Java and the fly likes Generics Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Make it so: Java DB Connections & Transactions this week in the JDBC forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Generics" Watch "Generics" New topic


yash Vi
Ranch Hand

Joined: Jul 17, 2005
Posts: 41
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

Thanks for your reply and time.<br />Windows 2000,j2sdk1.4.2_08
Barry Gaunt
Ranch Hand

Joined: Aug 03, 2002
Posts: 7729
You are using Java 5.0, right?

Ask a Meaningful Question and HowToAskQuestionsOnJavaRanch
Getting someone to think and try something out is much more useful than just telling them the answer.
I agree. Here's the link:
subject: Generics
It's not a secret anymore!