strs; // !!! The cause of the upcoming problem sits here. Java prohibits this! objs.add(1); // Here we put an Integer into a list of Strings String s = strs.get(0); // !!! ClassCastException: Cannot cast Integer to String Note: All generic types in Java are invariant!