| Author |
Stroring my own objects into Javas LinkedList?
|
Alex Almani
Greenhorn
Joined: Jan 08, 2004
Posts: 6
|
|
I was wondering how I store my own object into a LinkedList? For example if I have an object House defined I want to make a LinkedList of houses. I tried this: LinkedList ll=new LinkedList() House h1=new House(); ll.add(h1); but it did now work.. any suggestions?
|
 |
marc weber
Sheriff
Joined: Aug 31, 2004
Posts: 11343
|
|
When you say it didn't work, how do you know? Did you receive compilation errors? The only thing I see wrong with the snippet you posted is a semicolon missing after the first line. Other than that, my best guess is that you forgot to import java.util.*. [ October 07, 2004: Message edited by: marc weber ]
|
"We're kind of on the level of crossword puzzle writers... And no one ever goes to them and gives them an award." ~Joe Strummer
sscce.org
|
 |
 |
|
|
subject: Stroring my own objects into Javas LinkedList?
|
|
|