What are the shortcut to Auto-generating toString Method in Eclipse?

后端 未结 9 1297
遥遥无期
遥遥无期 2020-12-03 13:17

Is it good or bad practice auto-generating toString methods for some simple classes?

I was thinking of generating something like below where it takes th

9条回答
  •  遥遥无期
    2020-12-03 14:14

    In IntelliJ Idea you can press alt+insert, the Generate popup will open; now select the fields and click the OK button; that's it.

    Further tip: In the Generate toString dialog, it gives you a choice to select the template by clicking the drop down on the template combo box. Here you can select StringBuffer if you need to or any other template as required. Play with it to get accustomed. I like it :)

提交回复
热议问题