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