Hi Sridhar,
I think the o/p can be
vandeleur and can be possibly
vandeleur 0 1 2 3 .
in the code posted by you ,
at line 4 you r creating an object of the class Tux which extends
Thread class and at line 5 u r invoking the piggy by passing the
string "vandeleur" as argument.
since variables are always passed by value, any change to the string inside the method will not effect the actual value of the string .so, the vlaue of the string will be still "vandeleur" , even after the method piggy is called( but not "vandeleur wiggy").
At line 10, when start() is called , it invokes run() method and in the run method the string value is modified in the for loop.
So, after the completion of the run() method string will be holding a value of "vandeleur 0 1 2 3".
So, if the main thread prints string before completion of the run() by the child thread, then the o/p will be "vandeleur" only.
Otherwise , if it prints string after the completion of run() of child thread, it prints "vandeleur 0 1 2 3".
Hope this helps you.
Vineela