构造函数不能以普通函数的方式调用,只能在new的时候将参数传给构造函数,程序会根据参数匹配自动调用相应的构造函数。 a[0] = new Student("A",20061930,"20060622","男","计算机"); a[1] = new Student("c",20061931,"20060622","男","计算机"); a[2] = new Student("b",20061932,"20060622","男","计算机");
热心网友时间:2023-10-25 21:27
a[0] = new Student("A",20061930,"20060622","男","计算机");