2020-05-10 16:07:27 +02:00

15 lines
420 B
Java

public class main {
public static void main(String[] args) {
// create a new car and store it in the variable 'a'
// the constructor requires manufacturer and model to be specified
Car a = new Car("Benz", "Velo");
// do the same for a second car
Car b = new Car("Ford", "Model T");
// use a function of the car class to print out the information
a.print_info();
b.print_info();
}
}