I am having trouble understanding why the java compiler allows non-specific collections to assign collections in which a variable is specified. Like this:
ArrayList list = new ArrayList();
This has potential for all kinds of casting errors, it seems to me that it makes sense if the compiler stops you from doing this.
I just ask because I'm curious about this strange aspect of the language, I have no problem getting the code to work (although I could someday use an ArrayList with all kinds of classes in it).
source share