True,i ran in jdk on another machine it was coming properly.So far this compiler was working properly for all samples but looks getting weird with this kind of programs
.Not sure what could be the reason anyways I assume "Hello World" should not be coming once so its fine.Unfortunately due to some constraints I cannot install JDK in my machine so was sticking with that online sites but surely is misleading.
I guess JVM over there doesnot behave normally with the interbyte code which was main feature of java portability.Thanks for you suggustions:)