Win a copy of OCP Java SE 8 Programmer II Exam Study Guide this week in the OCP forum!
  • 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
 
Rancher
Posts: 2885
16
  • 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: 23451
46
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
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!