I would like to do something like this:
if (condition) super(foo.class); else super(bar.class);
But the superconstructor should be the first in the constructor. Is it possible to do this?
Assuming you call the same superconstructor in both cases and just pass a different argument, you can simply use the conditional operator:
super(condition ? Foo.class : Bar.class);