Win a copy of Practical SVG this week in the HTML/CSS/JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

wht is the diffrence?

 
vrayudu kumar
Ranch Hand
Posts: 79
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
public class A extends Thread{

public static void main(String []s) {

A a = new A();
a.start();
a.run();

}
public void run()
{
System.out.println("method from run");
}
}
 
Harshil Mehta
Ranch Hand
Posts: 64
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
call to start will spawn a new thread. whereas call to run will simply
execute in current thread.

that's all the threas are all about!!!
 
vrayudu kumar
Ranch Hand
Posts: 79
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Harshil
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!