wood burning stoves 2.0*
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes threads - start() & run() Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Bookmark "threads - start() & run()" Watch "threads - start() & run()" New topic
Author

threads - start() & run()

Shweta
Greenhorn

Joined: Oct 28, 2000
Posts: 2
What is the name of the method used to schedule a thread for execution and that for executing a thread?
init();
start();
run();
resume();
sleep();
feel it is start() and run() simultaneously.
Amit Tyagi
Ranch Hand

Joined: Oct 18, 2000
Posts: 52
Hi,
You are right.
Its run() - for executing a therad. &
start() - for scheduling a thread.

Amit
Ajith Kallambella
Sheriff

Joined: Mar 17, 2000
Posts: 5782
'Shweta',
PROPER NAMES ARE NOW REQUIRED!!
Read this post for more details.
Javaranch appreciates your cooperation to comply with the official naming policy.
Ajith

Open Group Certified Distinguished IT Architect. Open Group Certified Master IT Architect. Sun Certified Architect (SCEA).
Chrisis
Greenhorn

Joined: Nov 07, 2000
Posts: 3
you can not execute a thread. Calling start will put it in runnable state but calling 'run' will just use that method in the current thread. You can think of the 'thready' code existing in 'start' only.
 
Consider Paul's rocket mass heater.
 
subject: threads - start() & run()