子类名称提示错误,不知道为什么,求大神帮看看
主程序
package app;
public class App {
public static void main(String[] args) throws Exception {
Auto audi = new Auto(1,"Audi A4",500,4,0);
}
}
父类
package app;
public class Auto {
int num;
String name;
int price;
int passengers;
int carry;
public Auto(int newnum,String newname,int newprice,int newpassengers,int newcarry) {
num = newnum;
name = newname;
price = newprice;
passengers = newpassengers;
carry = newcarry;
System.out.println(num+". "+name+" "+price+" yuan/perday passenge:"+passengers);
}
}
子类
package app;
public class AudiA4 extends Auto{
}
子类名称提示错误:
Implicit super constructor Auto() is undefined for default constructor. Must define an explicit constructor
这是为什么?