满意答案
ldzhi
推荐于 2017.10.07
采纳率:43% 等级:12
已帮助:5491人
public class DateDemo {
public static void main(String[] args) {
1653java.util.Vector vs = new java.util.Vector();
for(int i = 0; i
vs.add(new Student(i,"张三"+i,"男",+1.72,65.03));
}
java.util.Iterator it = vs.iterator();
while(it.hasNext()){
System.out.println("---------------------------------");
Student st = it.next();
System.out.println("序号:" + st.num);
System.out.println("姓名:" + st.name);
System.out.println("性别:" + st.sex);
System.out.println("身高:" + st.shenggao);
System.out.println("平均成绩:" + st.pjcj);
}
}
}
class Student{
public int num;
public String name;
public String sex;
public double shenggao;
public double pjcj;
public Student(int num, String name, String sex, double shenggao, double pjcj){
this.num = num;
this.name = name;
this.sex = sex;
this.shenggao = shenggao;
this.pjcj = pjcj;
}
}
04分享举报