can someone tell me the order in which a thread starts to execute?. I have written the following code
class NewThread implements Runnable {
Thread t;
New
You have encountered a race condition.
You have stumbled across one of the complexities of multi-threading. If you have code that MUST be processed in a particular order you must "lock" that code and/or declare variables within it "volatile". Run a google search for "deadlocks" and "race conditions".