When is it desired to not implement toString() in Java?

后端 未结 24 2169
心在旅途
心在旅途 2020-12-10 00:45

A lead developer on my project has taken to referring to the project\'s toString() implementations as \"pure cruft\" and is looking to remove them from the code base.

<
24条回答
  •  余生分开走
    2020-12-10 01:11

    Although toString() methods are very useful for debugging value classes, it can be argued they are not useful for entity classes.

提交回复
热议问题