/home/kchan2/NetBeansProjects/CS1/src/people/PersonDemo2.java
 1 /*
 2  * Program that creates an array of person objects of size 6 and fill it with 
 3  * data. Then display the six person objects in their textual form.
 4  */
 5 package people;
 6 
 7 /**
 8  *
 9  * @author kchan2
10  */
11 public class PersonDemo2 {
12 
13     /**
14      * @param args the command line arguments
15      */
16     public static void main(String[] args) {
17         
18         // CREATE THE SIX PERSON OBJECTS
19         Person bd = new Person("Bob Dylan",5,24,1941);
20         Person nr = new Person("Noomi Rapace",12,28,1974);
21         Person pw = new Person("Pharrell Williams",4,5,1973);
22         Person fs = new Person("Frank Sinatra",12,12,1915);
23         Person dk = new Person("Diana Krall",11,16,1964);
24         Person kc = new Person("KaYing Chan",9,3,2000);
25 
26         // CREATE AN ARRAY OF PERSON OBJECTS OF SIZE 6 AND FILL IT WITH THE DATA
27         String people [] = new String[6];
28         people[0] = bd + " " + bd.initials() + " " + bd.isBoomer();
29         people[1] = nr + " " + nr.initials() + " " + nr.isBoomer();
30         people[2] = pw + " " + pw.initials() + " " + pw.isBoomer();
31         people[3] = fs + " " + fs.initials() + " " + fs.isBoomer();
32         people[4] = dk + " " + dk.initials() + " " + dk.isBoomer();
33         people[5] = kc + " " + kc.initials() + " " + kc.isBoomer();
34         
35         // USE A FOR LOOP TO DISPLAY THE SIX PERSON OBJECTS IN THEIR TEXTUAL FORM
36         for (int i = 0 ; i < people.length ; i = i + 1) {
37             System.out.println(people[i]);
38         }
39         
40     }
41     
42 }
43