Hi all,
I have discovered a strange thing while studying the interfaces part. Consider the following code:
Why does this code compile? ClassCastException is at the same level in the inheritance tree as IllegalArgumentException. They are both a direct subclass of RuntimeException. So they don't have a IS-A relationship with each other. And look at this:
IllegalArgumentException is a subclass of RuntimeException, so RuntimeException is a broader exception! So, why does this compile?
I hope someone is able to help me with this. I have installed
Java version 1.6.0_17
Kind regards, JT Hofstra