Add properties to car class
You will add more features to the Car class and a few properties that mimic a real car. A real car has endless features, but for now, you will only add the car's color, model, and year of manufacture.
Questo esercizio fa parte del corso
Introduction to Object-Oriented Programming in Java
Istruzioni dell'esercizio
- Add a string property
colorto theCarclass for thecolorof a car. - Add a string property
modelto theCarclass for themodelof a car. - Add an integer property
yearto theCarclass to theyeara car was made.
Esercizio pratico interattivo
Prova a risolvere questo esercizio completando il codice di esempio.
class Main {
static class Car {
// Create the properties for the class
____ ____;
____ ____;
____ ____;
}
public static void main(String[] args) {
}
}