Java Program for Automobiles [Packages]

Publié le: 20 juin 2022
sur la chaîne: JAVA CODER
34
3

Create a package called com.automobile. Define an abstract class called Vehicle.

Vehicle class has the following abstract methods:

public String getModelName()

public String getRegistrationNumber()

public String getOwnerName()

Create twowheeler subpackage under automobile package Hero class extends automobile.vehicle class with the following methods public int getSpeed()

returns the current speed of the vehicle.

public void radio()

provides facility to control the radio device

Honda class extends com.automobile.vehicle class with the following methods public int getSpeed()

Returns the current speed of the vehicle.

public void cdplayer()

provides facility to control the cd player device which is available in the car.

Create a test class to test the methods available in all these child class.

#javapackages #javaprogramming #javabasics #javatutorial #javaforintermediates #javascrpit


Sur cette page du site, vous pouvez voir la vidéo en ligne Java Program for Automobiles [Packages] durée heure minute seconde en bonne qualité , qui a été Téléchargé par l'utilisateur JAVA CODER 20 juin 2022, Partagez le lien avec vos amis et connaissances, sur youtube cette vidéo a déjà été regardée 34 fois et il a aimé 3 téléspectateurs. Bon visionnage!