I get activeWorkflows=null, but according to the database this activeworkflow can never be null
I traced it as follows
z=0 x=1 y=0
z=1 x=2 y=0
z=2 x=3 y=1(the && condition is true so x++ evaluated and x is now 4)
z=3 x=5 y=2(here x++ excecuted and x is 6 now)
z=4 x=7 y=3
so o/p should be x=7 and y=3 right?
but it is mentioned as x=6 and y=3
If you mean a stand-alone Java application, then no. The JVM looks for a method public static void main(String) as an entry to the application. Failing to find that, it will throw an exception and terminate.