2020-03-28 14:45:55 +01:00

19 lines
493 B
Java

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";
// Do the same for a second car
Car b = new Car();
b.manufacturer = "Ford";
b.model = "Model T";
// use a function of the car class to print out the information
System.out.println(a.get_info());
System.out.println(b.get_info());
}
}