// poly_arrays1 // demonstrating with initializer list this time // (why? it looks cool) class A { public int getVal() { return 1;} } class B extends A { public int getVal() { return 1+super.getVal(); } } class C extends A { public int getVal() { return 1+super.getVal(); } } public class poly_arrays1 { public static void main(String[] args) { A[] x = { new A(), // 1 new B(), // 2 new B(), // 2 new C() // 3 }; int sum = 0; for (int i=0; i