package proto; public class Main { public static void main(String[] args) { A ins[] = { new A(10), new B(5), new C(7), new D(8) }; for (int i = 0; i < 4; i++) { System.out.println(ins[i].get()); } } }