Maybe t has already executed the run() method before assigning a with "zebra
Both case is possible Yuan, thats why we cannot predict the answer. But usually main thread will change the value of a.
Pmason(){
a="alpha";
Thread t = new Thread(this);
t.start();
Thread t1 = new Thread(this);
a="zebra";
t1.start();
}
Pmason() constructor will be executed by main thread.
t.start() will be executed by main thread. It will fork a new thread and wait for schedular to make it running, or it could happen rarely that this new thread start executing run() before main could reach a="zebra". Forking process and new thread to reach running state will usually take more time than main thread to reach a="zebra". But you cannot say confirmly, it depends on thread schedular algorigth of the system.
In most of time main thread will reach a="zebra" before new thread could reach to run() method. These all things depends on the thread schedular.
If this type of question asked in exam, you have to select "cannot predict answer".
[ December 17, 2008: Message edited by: punit singh ]