问题描述:
Write a program,which performs as the following:(java)
Write a program,which performs as the following:
Create two interfaces Automobile and Nonautomobile.They contain abstract methods AutomobileMotionMode( ) and NonautomobileMotionMode( ).
Create a class VehicleClass to implement these two interfaces,and contain some methods to set and get the Vehicle’s attributes such as name,wheelNumber,ifAutomatic.A nonautomobilemotionmode is “Average speed is less than 20 kilometers per hour.” On the contrary,An automobilemotionmode is “Average speed is larger than 20 kilometers per hour.”
Create a BicycleClass.It’s a subclass of VehicleClass,which contain main() method.In the constructor of BicycleClass,invoke the methods in VehicleClass to set attributes and print them.
Write a program,which performs as the following:
Create two interfaces Automobile and Nonautomobile.They contain abstract methods AutomobileMotionMode( ) and NonautomobileMotionMode( ).
Create a class VehicleClass to implement these two interfaces,and contain some methods to set and get the Vehicle’s attributes such as name,wheelNumber,ifAutomatic.A nonautomobilemotionmode is “Average speed is less than 20 kilometers per hour.” On the contrary,An automobilemotionmode is “Average speed is larger than 20 kilometers per hour.”
Create a BicycleClass.It’s a subclass of VehicleClass,which contain main() method.In the constructor of BicycleClass,invoke the methods in VehicleClass to set attributes and print them.
问题解答:
我来补答展开全文阅读