toString Override in Java

后端 未结 6 2000
悲哀的现实
悲哀的现实 2021-01-25 09:12

This question is from an assignment. I have to override a toString() method in a class that creates a circularly linked list and I actually have a toString() method that works g

6条回答
  •  生来不讨喜
    2021-01-25 09:50

    Strings should always be used unless string builders offer an advantage in terms of simpler code or better performance

    if you need to concatenate a large number of strings, appending to a StringBuilder object is more efficient.

提交回复
热议问题