3 ms·
Especially because you were always able to bypass it by declaring a `static` function and calling that as part of the parameters to `super`: public Foo(int x)
by delusional 1y ago
Especially because you were always able to bypass it by declaring a `static` function and calling that as part of the parameters to `super`:
public Foo(int x) {
super(validate(x));
}
validate would run before super, even though super was technically the first statement in the constructor, and the compiler was happy.
- mystifyingpoi 1y agoThis is such a funny workaround, I like that. But it doesn't matter in any library or your own code, since factory methods are much better (simply because they have names).