public class Math extends School {
protected double numbercalc;
public Math(double numberpencil, double numberpapaer, double numberscis, double numbercalc) {
// We use the Superclass constructor for the shared attributes through the keyword "super"
super(numberpencil, numberpapaer, numberscis);
}
// hornSound is not in the Superclass, so we add it separately in the constructor
@Override
public void test () {
System.out.println("tets test");
}
public static void main(String[] args) {
// 5 argument constructor
Math william = new Math(2, 3, 1, 5);
william.test();
}
}
Math.main(null);