Originally posted by reubin nibuer:
I have this thought
"if the main thread ends before Tux thread' life time, (which print 1,2,3), the Tux thread will end accordingly, since Tux is created by main thread. This also indicates if the parent thread ends, all of its child threads will ends immediately accordingly."
is because I see the correct answer is saying: either "vandeleur", "vandeleur 0", "vandeleur 0 1" "vandaleur 0 1 2" or "vandaleur 0 1 2 3". -- the output sometimes does not output all of 0,1,2,3 in case main thread ends before Tux thread.
If the Tux thread always completes its task, the output should always contain vandeleur, 0, 1, 2, 3 with different orders, isn't it? How should it be explained about the case that 0,1,2,3 isn't printed fully, like: "vandeleur 0", "vandeleur 0 1" "vandaleur 0 1 2".
Thanks
Originally posted by Geethakrishna Srihari:
1.Whether a static reference to an object if either reassigned or assigned to null, the object becomes eligible to garbage collection?
2.Whether a string if reassigned to another or assigned to null becomes eligible for garbage collection?
Originally posted by reubin nibuer:
This means if the main thread ends before Tux thread' life time, (which print 1,2,3), the Tux thread will end accordingly, since Tux is created by main thread. This also indicates if the parent thread ends, all of its child threads will ends immediately accordingly. Am I right?
static sName value is not changed, which is because piggy method only changes its own parameter variable's value. Thanks for that notice, Soumya.
[ June 08, 2005: Message edited by: reubin nibuer ]
Originally posted by reubin nibuer:
I have a question here:
I thought answer is 2 but it is 4. Shouldn't it be t to call start(), not within piggy()?
Thanks
Originally posted by Jesse Torres:
Thanks for your input. Which phone do you have? I have Motorola V300.