The code works fine until I try to make the code into a constructable class. When I attempt to construct an object from it I get the error
\"Default
Base class super.constructor is implicitly invoked by the extending class constructor:
class Base
{
public Base () throws Exception
{
throw <>;
}
}
class Derived extends Base
{
public Derived ()
{
}
}
Now, one need to handle the exception inside Derived() or make the constructor as,
public Derived() throws Exception
{
}
Whatever method you new up the object of Derived, either you enclose it in try-catch or make that method throwing Exception as above.
[Note: this is pseudo code]