Why the following code is not getting compiled. Generally super is not allowed to be wrapped in try-catch, because if exception thrown in super shows that super didn't complete, so it shouldn't be wrapped. But what if I throw exception in the try catch block. This still indicates that the class is not constructed completely right. So java developers could have allowed this case when they throw exception in the try catch block around super right. Is there any reason for why this is not allowed. The other question which made this as duplicate asks about why the super has to be first statement in the constructor. But this one is regarding throwing different exception instead superclass's thrown exception.
class AA
{
AA() throws FileNotFoundException
{
throw new FileNotFoundException();
}
}
class BB extends AA
{
BB() throws Exception
{
try
{
super();
}
catch(Exception e)
{
throws new Exception();
}
}
}