|
|
|
|
|
by joachimma
796 days ago
|
|
> These include statements before super(…), which would give developers greater freedom in expressing constructor behavior – meaning string templates. This would make it easy to express strings that include values computed at run time – meaning scoped values. This would enable sharing of immutable data within and across threads; and implicitly declared classes and instance main methods. I don't like the restriction on code before super. But I don't have a clue what they are referring to here. The code example doesn't use a template either. PositiveBigInteger(long value) {
if (value <= 0)
new IllegalArgumentException("non-positive value");
super(value);
}
|
|
Trivial method calls such as „toString“ can already cause issues and it’s worse once you want to guarantee certain value types properties.