public class Monitor extends Peripheral {
public Monitor(){
super();
}
public Monitor (String name,String maker, int age, int price,String type,int size,String res,String ports){
super(name,maker,age,price);
this.type = typel
this.size = size;
this.res = res;
this.ports = ports;
}
}
This is the the child class.I want to make it so that I can create a monitor object without giving it any parameters. These are the classes of its parents:
public class Product {
protected String name, maker;
protected int age,price;
public Product(){}
public Product(String name,String maker, int age, int price){
this.name = name;
this.maker = maker;
this.age = age;
this.price = price;
}
}
public class Peripheral extends Product {
//basically nothing here
private static double discount = 0;
public static void setDiscount(double disc){
discount = disc;
}
public static double getDiscount(){
return discount;
}
}
The compiler says:error: constructor Peripheral in class Peripheral cannot be aplied to given types; super(); required: String,String,int,int found: no arguments