The document defines an abstract class 'Vehicle' with methods to set and get speed, and an abstract method 'move'. A 'Car' class extends 'Vehicle' and implements the 'move' method to print the car's speed. In the main function, a 'Car' object is created, its speed is set to 80, and the move method is called.
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0 ratings0% found this document useful (0 votes)
22 views1 page
Ostad Test
The document defines an abstract class 'Vehicle' with methods to set and get speed, and an abstract method 'move'. A 'Car' class extends 'Vehicle' and implements the 'move' method to print the car's speed. In the main function, a 'Car' object is created, its speed is set to 80, and the move method is called.