如果加上构造函数,改为这样,就找不到Student了package essential;
import java.util.Scanner;
public class Menu extends Student {
public Menu(String _studentNumber, String _name, String _major, int _math, int _computer, int _english) {
super(_studentNumber, _name, _major, _math, _computer, _english);
// TODO 自动生成的构造函数存根
}
public static void main(String[] args) {
Scanner in = new Scanner(System.in);
Student []stu = new Student[5];
stu[0] = new Student("Jack","软工","20183101",80,90,85);
stu[1] = new Student("Rose","大数据","20183102",99,93,90);
stu[2] = new Student("John","网安全","20183103",87,70,74);
stu[3] = new Student("Andi","网工程","20183104",67,66,68);
stu[4] = new Student("Mike","物联网","20183105",56,90,55);
}
}
报错为public class Menu extends Student {
^
符号: 类 Student
Menu.java:12: 错误: 找不到符号
Student []stu = new Student[5];
^
符号: 类 Student
位置: 类 Menu
Menu.java:12: 错误: 找不到符号
Student []stu = new Student[5]; |