1 package people; 2 3 public class PersonDemo2 { 4 public static void main(String[] args){ 5 6 Person bd = new Person("Bob Dylan",5,24,1941); 7 Person nr = new Person("Noomi Rapace",12,28,1974); 8 Person it = new Person("Isabelle Tracy",5,15,1998); 9 Person ny = new Person("Not You",1,2,2000); 10 Person kg = new Person("Keep Going", 2,21,1963); 11 Person so = new Person("Some Oldguy", 5,17,1772); 12 13 //create an array of the person objects 14 Person[] peop = new Person[6]; 15 peop[0] = bd; 16 peop[1] = nr; 17 peop[2] = it; 18 peop[3] = ny; 19 peop[4] = kg; 20 peop[5] =so; 21 22 //use a for loop to display the person objects in their textual form 23 24 for (int i = 0; i<peop.length; i=i+1) { 25 System.out.println(peop[i] + " " + peop[i].initials() + " " + peop[i].isBoomer()); 26 } 27 28 29 } 30 } 31