When I execute this code I get caughtjava.lang.CloneNotSupportedException
as an output! Why doesn't the NullPointerException
get caught?
package arrays;
public class NestedTry {
public static void main(String s[])
{
try{
try{
throw new NullPointerException();
}
finally{
throw new CloneNotSupportedException();
}
}
catch(Exception e)
{
System.out.println("caught"+e.toString());
//which excpetion will be printed here?? :P
}
}
}