“Супер класс Ява” Ответ

Супер класс Ява

/* Base class vehicle */
class Vehicle
{
    int maxSpeed = 120;
}
  
/* sub class Car extending vehicle */
class Car extends Vehicle
{
    int maxSpeed = 180;
  
    void display()
    {
        /* print maxSpeed of base class (vehicle) */
        System.out.println("Maximum Speed: " + super.maxSpeed);
    }
}
  
/* Driver program to test */
class Test
{
    public static void main(String[] args)
    {
        Car small = new Car();
        small.display();
    }
}
ap_Cooperative_dev

супер класс Tostring Java

   public String toString() {
        return super.toString() + ", isProfessional=" + isProfessional;
    }
Ares Azlan

Ответы похожие на “Супер класс Ява”

Вопросы похожие на “Супер класс Ява”

Больше похожих ответов на “Супер класс Ява” по Java

Смотреть популярные ответы по языку

Смотреть другие языки программирования