Now we're going to set up the dealership class.
From the requirements, we identified two types of objects, we already created the car class and we
found that a car class needs to blueprint five fields and one action.
The car class was the blueprint from which we can create car objects.
Also, from the requirements, we classified another type of object dealership.
So in this lesson, we're going to create the dealership clot's.
The dealership class is a manager class, the manager class manages objects of another class.
The dealership class is a manager class because it will manage objects of the car class.
We're going to start by creating the class inside the project, create another file named dealership
Java.
And inside a dealership class.
The dealership class needs to model every field and every action.
Looking back at the requirements, the dealership is identified by the cars that it manages cars, it's
plural.
So the field is going to be an array of car objects.
And making an array of objects is the same as making any other array play square brackets next to the
class type and set the array size.
This creates an array that can store three car objects.
So we can define this field in the dealership class.
And from a diagram standpoint, this is what our class looks like, the dealership also has two important
actions, which we're going to add later.
We're going to create an object of the dealership class.
We're going to call the variable dealership.
And we'll set it equal to a new dealership object.
And that's all you just created an object of the dealership class.
The object has one field cars, which by default is going to be No.
We need to update the cars field as soon as we create the object, and that's what a constructor is
for.
So we need to start by applying the big three steps, constructor getters and setters.
In this lesson, you made an object of the dealership class.
So far, the dealership class blueprint's one field, and as you know, whenever a class has fields,
you need to apply the big three steps at a constructor getters and setters.