Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class StudentTest {
- public static void main (String args[]) {
- Student studentList [] = new Student [4];
- studentList[0] = new Student ("Amy",11,"Female","Korean");
- studentList[1] = new Student ("Ben",6,"Male","English");
- studentList[2] = new Student ("Cat",19,"Female","Chinese");
- studentList[3] = new Student ("Dave",14,"Male","French");
- for (int x=0; x<4; x++) {
- System.out.println("Student No." + x);
- System.out.println("Name : " + studentList[x].getName());
- System.out.println("Age : " + studentList[x].getAge());
- System.out.println("Gender : " + studentList[x].getGender());
- System.out.println("Nationality : " + studentList[x].getNation());
- System.out.println("");
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement