I am asking that whether it is possible in the above code to have output as :
hello
one
main
hello
two Because print statement for hello occurs after print for thread name.So is it possible...
Type: Posts; User: peter_parker
I am asking that whether it is possible in the above code to have output as :
hello
one
main
hello
two Because print statement for hello occurs after print for thread name.So is it possible...
I have the following code on threads.I have a doubt that is it possible that any of the two threads created ie one and two will execute the 2nd print statement in run method before the first print...
I want to know that which block executed first catch or finally..I mean to say that after return in catch the jvm should leave the block without executing finally.Then why does value of a is 10 and...
public class HelloWorld{
static int a;
public static void main(String []args){
System.out.println("Hello World");
HelloWorld h =new HelloWorld();
a = h.foo();
...
Thank you sir actually I sort of knew the reason but was not sure..
This might be a very basic question but still I am not able to figure out why is the foll code giving stackoverflow exception in main??
public class HelloWorld{
public static void...