Task 3 - Movement of cars (objects) - solution:
Class Automobile is:
Figure 1: Class Automobile - definition
In the main class, we create the objects, and then the input data acceleration and time for both cars are entered:
Figure 2: Car movement-class definition
In the main class, we create the objects, and then the input data acceleration and time for both cars are entered:After starting the application:
Figure 3: Car movement-starting application
Return to additional example - classes and objects in JAVA
