class TestInstance { public static void main(String[] args) { Super[] supre = new Super[2]; supre[0] = new Sub1("Sub1"); supre[1] = new Sub2("Sub2"); for (Super instans : supre) { System.out.println(instans); if (instans instanceof Sub1) { Sub1 castet = (Sub1) instans; System.out.println(castet.tall1); } } } }