giddee up
giddee up
SCJP 1.4
giddee up
SCJP 1.4
Originally posted by John Paverd:
Jasper
static String sName = "vandeleur";
...
sName = sName + " " + 0; // sName is now "vandeleur 0"
sName = sName + " " + 1; // sName is now "vandeuler 0 1"
This is just string concatenation.
giddee up
Originally posted by Jasper Vader:
A small point John - strictly speaking, i guess one should really call t.start() rather than t.run() ?
but in the original code up the top, there was a bit of string concatenation going on with the code
public void piggy(String sName){
sName = sName + " wiggy";
but that concatenation did not occur. just confuses me why it can happen at the end there?
SCJP 1.4
SCJP 1.4
Originally posted by John Paverd:
Did the JVM move the thread running main to the runnable state, and allow the new thread to complete before running the main thread again?
Then the output would be vandeleur 0 1 2 3
Did the JVM complete the execution of the main method before running the new thread?
Then the output would be vandeleur
giddee up
Originally posted by Pallavi Chakraborty:
I am wondering about what happens to the method piggy.
The concern stems from the following.
Consider this code from Heller/Roberts book.
...
The question is "If you attempt to complie and
execute the following application, will it ever print - In xxx ?"
The answer is Yes.
SCJP 1.4
Don't get me started about those stupid light bulbs. |