Re: a collection of Vehicles
which collections will "be better" depends on your needs. do you need no duplicates, fast iteration, fast deleting, sorting etc. in general an arraylist is ok, but tell if you have some special requirements.
Re: a collection of Vehicles
ok i will write some more info so you understand better . i have some more classes the concrete subclass of car which is rentableCar and rentablecar implements the interface rentable and a Date class .Cos of the Vehicle being abstract all of the fields are transferred to car and all the fields are transfered again to rentablecar All of the dates are created from the date class
The depot class has two fields Depot Name and A collection of Vehicles where at the moment i have this private arrayList <Vehicle> vehicleList . The methods of depot are Add vehicle , find vehicle by make , remove vehicle , rent vehicle and return vehicle --
The only place the date of the return is recorded is in the rentablecar class so i need to connect the depot with the rentablecar class to get the rent Vehicle method working , can i create a method that adds 10 vehicles inside the depot class like a tester ?