This is because there is an Exception for arrays--ArrayStore Exception while Generics are only a compile time protection with no run time exception.
That is, the line
List<Number> l=new ArrayList<Number>();
is only checked at compile time. At run time it becomes
List l=new ArrayList();
And if you are allowed to add a Float into Integer list at compile time just imagine what will happen to your code at run time
