NamedCow named = (NamedCow)myFarm[3]; System.out.println(named.getName());