public class student {
private String name;
private int id;
private int age;
private int weight;
private int height;
public student(String name, int id, int age, int weight, int height) {
this.name = name;
this.id = id;
this.age = age;
this.weight = weight;
this.height = height;
}
public void display() {
System.out.println( this.name );
System.out.println( this.id );
System.out.println( this.age );
System.out.println( this.weight );
System.out.println( this.height );
}
public static void main(String[] args) {
student[] info = { new student("Bun Tun", 00001, 18, 68, 149),
new student("FlukeKnub", 00002, 17, 50, 179),
new student("BasBomba", 00003, 20, 44, 188),
new student("GaseKiki", 00004, 21, 67, 180),
new student("PeeJa",00005, 15, 88, 155)};
display_info(info);
}
public static void display_info(student[] e) {
int i = 0;
while ( i < e.length) {
e[i].display();
System.out.println();
i = i + 1;
}
}
}
ไม่มีความคิดเห็น:
แสดงความคิดเห็น