Java Program for Automobiles [Packages]

Опубликовано: 20 Июнь 2022
на канале: 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


На этой странице сайта вы можете посмотреть видео онлайн Java Program for Automobiles [Packages] длительностью часов минут секунд в хорошем качестве, которое загрузил пользователь JAVA CODER 20 Июнь 2022, поделитесь ссылкой с друзьями и знакомыми, на youtube это видео уже посмотрели 34 раз и оно понравилось 3 зрителям. Приятного просмотра!