class base{
base() throws Exception
{throw new Exception();}
}
class derived extends base {
derived() throws Exception{}
}
public class test2 {
public static void main (
String[] args){
try{
derived d =new derived();
} catch (Exception e){ System.out.println("Exception caught");}
}
}
i'm not so sure how u can catch the exception in the subclass itself; but the above code could be a possible solution when your main() method is not in the subclass