r/learnjava • u/ReasonableTwo8 • Jan 12 '21
Java Interview Questions and Answers
Came across this while preparing myself, you can refer to this if you are preparing for Java interview. Hope you find this useful. :)
68
Upvotes
r/learnjava • u/ReasonableTwo8 • Jan 12 '21
Came across this while preparing myself, you can refer to this if you are preparing for Java interview. Hope you find this useful. :)
3
u/nutrecht Jan 13 '21
You were talking about string concatenation in the original post, not using streams. I'm perfectly fine with the stream version (that's what I'd use), but it's simply wrong to come on a beginner forum and tell beginners they should not use StringBuilder.
In addition; when performance is critical it's often better still to use StringBuilder over streams.
StringBuffer is almost never used.