String s = "Hello"; String s2= "Java"; s.concat( s2 );
Answer is false ?!? Could that be a mistake or have I mis-understood the question ?
Unity can only be manifested by the Binary. Unity itself and the idea of Unity are already two.
osman cinar eren
Joined: Jan 25, 2005
It really is false. that is about the String class in Java. String objects are IMMUTABLE. that is:
s.concat(s2) creates a new object whose value is equal to s+s2, but as this new object is not referenced by any variable, it is unreachable. On the other hand, the original object referenced by 's' remains unchanged.
You should read on the concept of String.
hope this helps.
Joined: Jan 24, 2005
s i do agree.... If u dont create a object reference to the string the content will be lost. But with StringBuffer it doesnt happens like that.