Well plz refer to page number 101 in which he says constructors cannot specify exceptions in header .....
Why is this working then ?
class base
{
base() throws Exception
{
try
{
System.out.println("I am in the Base : Try");
throw new Exception();
}
catch(Exception e)
{
System.out.println("I am in the Base : Catch");
}
throw new Exception();
}
}
public class derived extends base
{
derived() throws Exception
{
}
public static void main(String args[])
{
try
{
new derived();
}
catch(Exception e)
{
}
}
}