Afrikaans
Akan
Albanian
Amharic
Arabic
Armenian
Azerbaijani
Basque
Belarusian
Bemba
Bengali
Bihari
Bosnian
Breton
Bulgarian
Cambodian
Catalan
Cebuano
Cherokee
Chichewa
Chinese (Simplified)
Chinese (Traditional)
Corsican
Croatian
Czech
Danish
Dutch
English
Esperanto
Estonian
Ewe
Faroese
Filipino
Finnish
French
Frisian
Ga
Galician
Georgian
German
Greek
Guarani
Gujarati
Haitian Creole
Hausa
Hawaiian
Hebrew
Hindi
Hmong
Icelandic
Igbo
Indonesian
Interlingua
Irish
Italian
Japanese
Javanese
Kannada
Kazakh
Kinyarwanda
Kirundi
Kongo
Korean
Krio (Sierra Leone)
Kurdish
Kurdish (Soranรฎ)
Kyrgyz
Laothian
Latin
Latvian
Lingala
Lithuanian
Lozi
Luganda
Luo
Luxembourgish
Macedonian
Malagasy
Malay
Malayalam
Maltese
Maori
Marathi
Mauritian Creole
Moldavian
Mongolian
Myanmar (Burmese)
Montenegrin
Nepali
Nigerian Pidgin
Northern Sotho
Norwegian
Norwegian (Nynorsk)
Occitan
Oriya
Oromo
Pashto
Persian
Polish
Portuguese (Brazil)
Portuguese (Portugal)
Punjabi
Quechua
Romanian
Romansh
Runyakitara
Russian
Samoan
Scots Gaelic
Serbian
Serbo-Croatian
Sesotho
Setswana
Seychellois Creole
Shona
Sindhi
Sinhalese
Slovak
Slovenian
Somali
Spanish
Spanish (Latin American)
Sundanese
Swahili
Swedish
Tajik
Tamil
Tatar
Telugu
Thai
Tigrinya
Tonga
Tshiluba
Tumbuka
Turkish
Turkmen
Twi
Uighur
Ukrainian
Urdu
Uzbek
Vietnamese
Welsh
Wolof
Xhosa
Yiddish
Yoruba
Zulu
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.
Can't find what you're looking for?
Get subtitles in any language from opensubtitles.com, and translate them here.