3 ms·
Using StringBuffer may be premature optimization. Java compiler will replace simple String concatenation with StringBuffer automatically [1] and you do not need
by miskin 7y ago
Using StringBuffer may be premature optimization. Java compiler will replace simple String concatenation with StringBuffer automatically [1] and you do not need to polute your code with StringBuffer unless you really find that to be performance bottleneck.
[1] https://docs.oracle.com/javase/specs/jls/se8/html/jls-15.html#jls-15.18.1 https://docs.oracle.com/javase/specs/jls/se8/html/jls-15.htm...