its simple. there are certain sequece followed when loading classes.
> all the static variables & methods (in the order they occur) > all the init blocks ( in the oder they occur) > the constructor that was invoked using new
case 1: when you are accesing the var x .. it has only been declared (so its default value is 0) init block hasn't been executed yet but when accessing the variable y you are creating a new instance of class & so the init block & constructors are executed & so y becomes 3 ( so x becomes 4 ... check it)
Case 2: in this case you are creating the instance of class 1st before accessing the vartiables so they are initialised to x = 4 & y = 3