constructor of class that extends another class code example
Example 1: 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;
}
}
Example 2: constructor of class that extends another class
public class Vehicle {
private String regNo = null;
public Vehicle(String no) {
this.regNo = no;
}
}