1 /* 2 * Program similar to PersonDemo1 But instead using arrays 3 */ 4 5 package people; 6 7 public class PersonDemo2 { 8 9 public static void main(String[] args) { 10 11 Person[] persons = new Person[6]; 12 persons[0] = new Person("Bob Dylan", 5, 24, 1941); 13 persons[1] = new Person("Noomi Rapace", 12,28,1974); 14 persons[2] = new Person("Pharrell Williams" ,8,24,1953); 15 persons[3] = new Person("Frank Sinatra" ,9,29,2009); 16 persons[4] = new Person("Diana Krall" ,5,7,1999); 17 persons[5] = new Person("Kevin Ciosek" ,10,26,2001); 18 19 //Display 20 int i = 0; 21 while (i< persons.length) { 22 System.out.println(persons[i]); 23 i++; 24 } 25 26 27 } 28 29 30 }