Closed michaelficarra closed 8 years ago
f()
will be evaluated when new A()
is executed.
The same for g()
.
new A
should throw when b
's initializer is executed.
Amirite?
new A
will throw and neither f()
, nor the constructor()
method itself will be evaluated here.
So new A
is guaranteed to evaluate the initialiser of b
before the initialiser of c
and before the constructor body?
intended to run once for each field in the order they are declared
Is
f()
evaluated? Isg()
? Doesnew A
throw? If not, what is the value ofnew A().b
?