| Author |
OOP 4 - Lookup
|
Amber Woods
Ranch Hand
Joined: Mar 28, 2001
Posts: 111
|
|
I have been working on my code for OOP 4 - Lookup Assignment but my code comes to 150 lines as opposed to the instructors of 120. First in main, I create all of my objects: Videos, Books On Tape, and Furniture. Then I create the hashmap and use put for each object I created. Is there and easier way to create the Hashmap other than having one put line for each object I created? I feel like there is a better way to do this and I am just not seeing it. Any Suggestion? Amber [This message has been edited by Amber Woods (edited May 23, 2001).]
|
"Happiness is a way to Travel, <b>Not</b> a Destination" -- Unknown
|
 |
Marilyn de Queiroz
Sheriff
Joined: Jul 22, 2000
Posts: 9033
|
|
That's the best way to initialize your HashMap. Don't worry too much about the length of the code. Concentrate on making your code as readable as possible.
|
JavaBeginnersFaq
"Yesterday is history, tomorrow is a mystery, and today is a gift; that's why they call it the present." Eleanor Roosevelt
|
 |
Amber Woods
Ranch Hand
Joined: Mar 28, 2001
Posts: 111
|
|
Thanks Marilyn Amber
|
 |
 |
|
|
subject: OOP 4 - Lookup
|
|
|