Could anyone explain how Java executes this code? I mean the order of executing each statement.
public class Foo
{
boolean flag = sFlag;
static Foo f
at first static fields should run and at first inline! so at first line 4 and then 5 will run so foo is initialized first and as we know boolean variables are initialized to false by default so at first so as the foo is initialized the field of flag is sflag that's false and then sfalsg becomes true that won't change flag( there's no relation) then at last main runs and print falg that is false!!! I hope to be useful! Be successful