19 lines
457 B
Java
Raw Normal View History

2020-03-28 14:45:55 +01:00
public class main {
public static void main(String[] args) {
// create a new car and store it in the variable 'a'
Car a = new Car();
// set some data for that car
a.manufacturer = "Benz";
a.model = "Velo";
2020-03-28 19:49:57 +01:00
// do the same for a second car
2020-03-28 14:45:55 +01:00
Car b = new Car();
b.manufacturer = "Ford";
b.model = "Model T";
// use a function of the car class to print out the information
2020-03-28 19:49:57 +01:00
a.print_info();
b.print_info();
2020-03-28 14:45:55 +01:00
}
}