Originally posted by asha ganapathy:
oh i guess it was running with an older version of .class file
I doubt that would cause a failure as described.
javac 1.5.0_12
java version "1.5.0_12"
In general, toString often constructs a new String reference.
But not always:
[asha ganapathy:] ... wanted to know how toString() function performs. Try not to guess unless you are investigating borderline conditions or doing intentionally exploratory work.
re:
One more clarification required..what is equals() method used for?
s1.equals(s2) -> checks if both Strings have same value or not?
please correct me if i am wrong.
posted Sunday, August 05, 2007 8:07 PM in Java (beginner) Strings
t = 023603 (topic)
f=33 (forum)
In general, == should be used to test for equality of primitives,
use dot equals for everything else .... there is no substitute for testing.
[ August 30, 2007: Message edited by: Nicholas Jordan ]