| Author |
string and string buffers?
|
senthil sen
Ranch Hand
Joined: Oct 10, 2002
Posts: 182
|
|
string sq="String object1"+String object2" here there are 2 objects created stringbuffer sq="String object1"+String object2" well since string buffers are growable these two string objects are placed in the string buffer object. what happens in the string object above??
|
 |
Pete Harris
Ranch Hand
Joined: Feb 05, 2003
Posts: 39
|
|
Originally posted by senthil sen: string sq="String object1"+String object2" here there are 2 objects created
Here, there is 1 object created, containing the String "String object1Stringobject2" (ignoring the typo).
Originally posted by senthil sen: stringbuffer sq="String object1"+String object2" well since string buffers are growable these two string objects are placed in the string buffer object.
This fails to compile as String and StringBuffer are incompatible types.
|
 |
senthil sen
Ranch Hand
Joined: Oct 10, 2002
Posts: 182
|
|
if String s1= "Stringobj1"+Stringobj2"; does s1 carry \both the string object? will it make stringobj1 and stingobj2 as one object??explain?? And why is that stringbuffer is not compatible to string object???explain
|
 |
 |
|
|
subject: string and string buffers?
|
|
|