Is string concatenation in scala as costly as it is in Java?

前端 未结 4 671
陌清茗
陌清茗 2020-12-29 18:17

In Java, it\'s a common best practice to do string concatenation with StringBuilder due to the poor performance of appending strings using the + operator. Is the same practi

4条回答
  •  一生所求
    2020-12-29 18:40

    Scala uses java.lang.String as the type for strings, so it is subject to the same characteristics.

提交回复
热议问题