Package crms.lib
Class CarFactory
java.lang.Object
crms.lib.CarFactory
CarFactory is a factory class designed to create
Car
objects
Its main purpose is to make sure that created Car
objects always have
a unique ID.
-
Constructor Summary
-
Method Summary
-
Constructor Details
-
CarFactory
-
-
Method Details
-
createCar
Creates aCar
object with specified brand, model, description, and price. This method makes sure that theCar
object has a unique ID;- Parameters:
brand
- Brand of the carmodel
- Model of the cardescription
- Description of the carprice
- Price of the car- Returns:
Car
object with a unique ID
-