Answers for "constructor of class that extends another class"

0

constructor of class that extends another class

public class Vehicle {
    private String regNo = null;

    public Vehicle(String no) {
        this.regNo = no;
    }
}
Posted by: Guest on April-29-2021
0

constructor of class that extends another class

public class Car extends Vehicle {
    private String brand = null;

    public Car(String br, String no) {
        super(no);
        this.brand = br;
    }
}
Posted by: Guest on April-29-2021

Code answers related to "constructor of class that extends another class"

Browse Popular Code Answers by Language