Only 48 hours left in the trailboss' kickstarter!

New rewards and stretch goals. CLICK HERE!



  • Post Reply Bookmark Topic Watch Topic
  • New Topic

which thread responsible to perform this code ? ?  RSS feed

 
Nada Mohammed
Ranch Hand
Posts: 30
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello ,
is the follwoing code mean that when i create object of type f for example :
f ff=new f();
then this object (ff) will has its new thread then this new thread will perform run method or the thread whose create object ff will be responcible to perform all instructions in the construcuter (include run method) ??
class f {
f() { new Thread(new Runnable() {
public void run() {
System.out.println("i'm inside run method ") ;
}
}).start();
}
}
Thanks alot
 
Fred Abbot
Ranch Hand
Posts: 300
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Can you edit the post so that it is readable thank you
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!