package student;
public class Student {
private String name;
private int age;
public Student(String name, int age) {
super();
this.name = name;
this.age = age;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public int getAge() {
return age;
}
public void setAge(int age) {
this.age = age;
}
public static void main(String[] args) {
Student[] s=new Student[3];
Student s1=new Student("Danie",30);
Student s2=new Student("Lena",19);
Student s3=new Student("zhuzhu",1);
s[0]=s1;
s[1]=s2;
s[2]=s3;
for(int i=0;i<s.length;i++)
System.out.println(s[i].getName()+"-----"+s[i].getAge());
}
}