public class MainState { /** * @param args */ public static void main(String[] args) { // TODO Auto-generated method stub State ca = new State("CA", 33871648, 12.03); State tx = new State("TX", 20851820, 7.41); State ny = new State("NY", 18976457, 6.74); State fl = new State("FL", 15982378, 5.68); System.out.println(ca.getPopulation()); State list[] = new State[4]; list[0] = ca; list[1] = tx; list[2] = ny; list[3] = fl; int total =0; for(int i=0; i< list.length; i++) { total = total + list[i].getPopulation(); } System.out.println("Answer " + total ); } }