If line 1 would have compiled, then it would have removed the type safety that generics provide.
Suppose the following line would have compiled
ArrayList<Object> l = new ArrayList<Integer>();
then you could have done this
l.add(new
String("hello"));
as l is of type Object and String is a sub-type of Object. Then look at the following code
So as you can see that in that case, there would be a run-time exception. This is what we are trying to avoid using Generics...