To use two ArrayList's or HashMap?

Hi,

I'm just a bit confused which to use here so was wondering could someone help me out please. My guideline is as follows.

A tax office registers a wide variety of vehicles, each of which has a license number, description, horsepower, year of manufacture, engine size and owner. Some vehicles are Heavy Goods Vehicles and for these HGV's, the tachometer number is stored(use inheritance).

Each vehicle has one owner and data stored about an owner includes id, name, and address.

The tax office needs to be able to:

Create new vehicles

Create new owners

And a few other things that i don't need to mention.

Basically what i want to know is in the Class TaxOffice should i use a HashMap of vehicles and have the vehicle object as the key and the owner as the value?

Or should i have two ArrayList's, one for vehicles and one for owners?

Thanks alot.

Message was edited by:

Capsud

[963 byte] By [Capsuda] at [2007-11-27 4:10:49]
# 1
To me it sounds like you should have one list, and that the vehicle class should have attributes for the owner.Kaj
kajbja at 2007-7-12 9:16:28 > top of Java-index,Java Essentials,New To Java...