public class Student {
String name;
int age;
public Student(String name,int age) {
this.name=name;
this.age=age;
}
}
public class text {
public static void main(String[] args) {
// TODO Auto-generated method stub
Student[] a = new Student[5];
a[0] = new Student("小红",20);
a[1] = new Student("小明",18);
a[2] = new Student("小蓝",20);
a[3] = new Student("小绿",21);
a[4] = new Student("小花",19);
for(int i = 0; i<a.length;i++) {
System.out.println(a[i].name+" "+a[i].age);
}
}
}