Iam using
Java 1.6 version.I have one overridden method and one overriding method as shown below.
Overridden method : public void div(int a,int b)throws ArrayIndexOutOfBoundsException
{
System.out.println("Hai this is the super class div method");
}
Overriding method : public void div(int a,int b)throws IndexOutOfBoundsException
{
System.out.println("Hai this is the sub class div method");
}
If you can observe Iam throwing the super class exceptio type in the overridding method(IndexOutOfBoundsException is super class of ArrayIndexOutOfBoundsException) , Still the code is getting compiled and ran.
Iam totally confused.Please help me out.Some one Give me full details.