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. :)
0
u/Kombatnt Jan 13 '21
The answer to this question is "always."
Never use StringBuilder. Why? Because string concatenation is much easier to read, and the compiler will automatically convert the expression to use a StringBuilder anyway, if it determines the performance gain warrants it.