| Author |
Question regarding println statement
|
Arjun Reddy
Ranch Hand
Joined: Nov 10, 2007
Posts: 624
|
|
Hi all, Why does the first println statement in the following code works and the other does not? Is it because in the first println statement, 12 is actually converted to a string? and in the second println statament, bye is considered as some variable that has not been initialized something? please explain. Thanks.
|
Be Humble... Be Nice.
|
 |
Campbell Ritchie
Sheriff
Joined: Oct 13, 2005
Posts: 32833
|
|
|
Yes, because you haven't declared or initialised "bye." Actually the 2nd println statement won't compile, it would work if bye existed.
|
 |
Arjun Reddy
Ranch Hand
Joined: Nov 10, 2007
Posts: 624
|
|
|
Thanks.
|
 |
Campbell Ritchie
Sheriff
Joined: Oct 13, 2005
Posts: 32833
|
|
You're welcome.
|
 |
 |
|
|
subject: Question regarding println statement
|
|
|