Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

using plus inside StringBuffer

 
Ranch Hand
Posts: 323
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Ranch Hand
Posts: 52
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Report post to moderator
Yups kundan,

Those string were created in the String pool.

ThanQ
[ August 25, 2004: Message edited by: Vicky Jain ]
 
Ranch Hand
Posts: 7729
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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