Is it possible to call the constructor of a parent-class not at the first line of the child?
I would like to build something like this (see constructor B).
class A
{
public A () {}
public A (int x) { // do something }
}
class B extends A
{
public B (int y)
{
if (y > 0) { super (y); }
}
}
I think with the existence of a default-constructor it is called automatically. Without it it would need to call super for the 1st line in B ().
Is it possible to call the other constructor (with the parameter) AFTER the 1st line - or have the same effect?