PersonDemo2.java
1    
2    
3            /* 
4             * A program that create an array of person objects of size 6 and fill it with the data. 
5             * Then use a for loop to display the six person objects in their textual form. 
6             */
7    
8            package people;
9    
10   public class PersonDemo2 {
11   
12       public static void main(String[] args){
13           // Create an array of person objects of size 6 and fill it with the data
14           Person person[] = new Person[6];
15           person[0] = new Person("Bob Dylan" ,5,24,1941);
16           person[1] = new Person("Noomi Rapace", 12,28,1974);
17           person[2] = new Person("Pharrell Williams", 9,15,2554);
18           person[3] = new Person("Frank Sinatra", 11,22,3344);
19           person[4] = new Person("Dianna Krall", 4,26,2241);
20           person[5] = new Person("Kuncheng Feng", 3,28, 5041);
21   
22           // DISPLAY THE SIX PERSON OBJECTS TO THE STANDARD OUTPUT STREAM.
23           for (int i = 0; i <= 5; i++) {
24               System.out.println(person[i] + " " + person[i].initials() + " " + person[i].isBoomer());
25           }
26       }
27   }
28