import java.util.*;
public class Student
{
String name;
}
class Course
{
Student[] stu = new Student[3];
Scanner scan = new Scanner(System.in);
for(int i = 0; i < stu.length; i++)
{
stu[i].name = scan.next;
}
}
为什么stu[i].name = scan.next;这一句会报错,无法将从键盘接收到的字符串保存到stu这个
数组中