package zyntm;
import java.util.ArrayList;
import java.util.Scanner;
public class Users {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
ArrayList<String> stu = new ArrayList<String>();
ArrayList<Student> stu1 = new ArrayList<Student>();
int i = 0;
while(true){
String stuID = sc.next();
stu.add(stuID);
stu1.get(i) = new Student(stuID.substring(0, 4),stuID.substring(4, 6),stuID.substring(6, 8),stuID.substring(8, 10));
i++;
}
class Student {
String year;
String spe;
String class1;
String num;
Student(String year,String spe,String class1,String num){
this.year = year;
this.spe = spe;
this.class1 = class1;
this.num = num;
}
public String getYear() {
return year;
}
public String getSpe() {
return spe;
}
public String getClass1() {
return class1;
}
public String getNum() {
return num;
}
}
}
}
第十三行:怎么让Student类型的数组stu1调用下面的Student方法?