I have following code:
class A{}
class B extends A {
volatile boolean flag=false;
B(){}
}
When I create a new instance of B
using new B()
, the flag value is set to true
. But if I explicitly set flag = false
in the constructor, then the flag
value is set properly to false
.
Is this a bug in Java 8 ?
Aucun commentaire:
Enregistrer un commentaire