hi ,
i have a doubt about
string declaration
String s = new string("abc");
this type of declaration creates two objects and one refrence variable.
1)
java will create new string object in normal(nonpool) memeory
2)"abc" will be placed in the pool.
so when we say for example
s.concat("def")
New object will be created in the pool "abcdef" and also
will "abcdef" object will be created in normal(nonpool) memory ? that means will there be total 4 objects ?
1)"abc"(in pool)
2)"abc"(in nonpool memory)
3)"abcdef"(in pool)
4)"abcdef" (in nonpool)
please clear my doubt...
what i want to ask is
point no1) by using this kind of declaration we are creating two objects and one ref variable so any concat ,or such type of operation will create multiple objects ?like in example above ...
after concat
4 objects will be created or just object in pool memory will be craeted?