public class Tux extends
Thread {
static
String sName = "vandeleur";
public static void main(String argv[]) throws InterruptedException
{
Tux t = new Tux();
t.piggy(sName);
System.out.println(sName);
}
public void piggy(String sName) throws InterruptedException
{
sName = sName + " wiggy";
start();
Thread.sleep(100);
}
public void run()
{
for(int i=0;i < 4; i++)
{
sName = sName + " " + i;
try
{
Thread.sleep(50);
}catch(InterruptedException e)
{}
}
}
}
I don't understand the output. The answer seems to be either "vandeleur" or "Vandeleur 0", Vandeleur 0 1, ...
What I am not clear is what happend to the sname=sname+"wiggy" operation before the thread is spurn off ?
The method call where "start" is encoded belongs to parent thread of new thread ? either way this operation is completely ignored.. Please let me know what's actually happening over here