Package crms.lib
Class Car
java.lang.Object
crms.lib.Car
Represents a unit of a car in the system.
This class contains information about the car, including its brand, model, description, price, and a unique ID.
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptiongetBrand()
Gets the brand of theCar
.Gets the description of theCar
.getId()
Gets the unique ID of theCar
.getModel()
Gets the model of theCar
.double
getPrice()
Gets the price of theCar
.void
setDescription
(String description) Sets the description of theCar
.void
setPrice
(double price) Sets the price for theCar
.
-
Constructor Details
-
Car
Constructs aCar
object with the specified ID, brand, model, description, and price.- Parameters:
id
- the unique ID of the carbrand
- the brand of the carmodel
- the model of the cardescription
- a description of the carprice
- the price of the car
-
-
Method Details
-
setPrice
public void setPrice(double price) Sets the price for theCar
.- Parameters:
price
- the price to set
-
getPrice
public double getPrice()Gets the price of theCar
.- Returns:
- the price of the car
-
getId
-
getDescription
-
setDescription
Sets the description of theCar
.- Parameters:
description
- the description to set
-
getBrand
-
getModel
-