• Post Reply Bookmark Topic Watch Topic
  • New Topic

Do I need to use a stringbuffer?  RSS feed

 
Ranch Hand
Posts: 495
Chrome Java Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Here is a part of my code simplified for my question:

Do I need to use the StringBuffer at all?
Thanks,
cc11rocks aka John Price
 
Ranch Hand
Posts: 2835
15
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Do I need to use the StringBuffer at all?



To do what?

What is your requirement? We are not mind readers!
 
Sheriff
Posts: 22951
43
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I wouldn't say you don't NEED it... but you create it and then append null to it. That's all you do. There must be an easier way to do that.
 
john price
Ranch Hand
Posts: 495
Chrome Java Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It was part of some previous code I had received. I think I do not need it. I removed it and it is working fine.
Thank you guys,
John Price aka cc11rocks
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!