新手求助,这个程序怎么初始化
class Course{
String name;
int score;
int credithour;
}
class Student
{
String name=new String();
int credithour;
int coursenumber=1;
Course course[]=new Course[coursenumber];
}
public class NewClass {
public static void main(String args[])
{
Student stu=new Student();
stu.course[0].name=new String("a");
}
}
对stu.course[0].name怎样初始化,上面的是错误的