Remember, the older legacy code was allowed to put anything at all (except primitives) into a collection. And in order to support legacy code, Java 5 and Java 6 allows for newer type safe code to make use of older code (the last thing Sun wanted to do was ask several million Java developers to modify all their exiting code).
However, just because the Java 5 compiler allows this code to compile doesn't mean it has to be HAPPY about it. In fact the complier will warn you that you're taking a big, big risk....
William Butler Yeats: All life is a preparation for something that probably will never happen. Unless you make it happen.
Rahul Choudhary wrote:If explanation is given for such concept in K&B please could you provide me with page number.
Did you see how Paul cut 87% off of his electric heat bill with 82 watts of micro heaters? |