Bookmark Topic Watch Topic
  • New Topic

using plus inside StringBuffer

 
kundan varma
Ranch Hand
Posts: 323
  • Mark post as helpful
  • send pies
  • Report post to moderator
HI all
Suppose i have 3 variables. If i write like this
StringBUffer sb = new StringBuffer("[");
sb.append("',"+variable1+",'");
sb.append("',"+variable2+",'");
sb.append("',"+variable3+",'");
Is this code creating new string objects because of using + inside append.

THanks
kundan
 
Vicky Jain
Ranch Hand
Posts: 52
  • Mark post as helpful
  • send pies
  • Report post to moderator
Yups kundan,

Those string were created in the String pool.

ThanQ
[ August 25, 2004: Message edited by: Vicky Jain ]
 
Barry Gaunt
Ranch Hand
Posts: 7729
  • Mark post as helpful
  • send pies
  • Report post to moderator
This is a duplicated topic so I'm closing it. Please post your responses here
[ August 25, 2004: Message edited by: Barry Gaunt ]
 
    Bookmark Topic Watch Topic
  • New Topic