# 生成 toString() 对话框

> For the complete documentation index, see [llms.txt](https://www.jetbrains.com.cn/help/idea/llms.txt).

`代码 | 生成 - toString()`

|  条目  |  描述  |
| --- | --- |
|  模板  |  点击此下拉列表以选择要使用的模板。  |
|  设置  |  点击此按钮以显示 [toString() 生成设置对话框](generate-tostring-settings-dialog.html) 并设置   生成 toString()   功能的行为和模板。  |
|  类成员树视图  |     点击要包含在生成的  `toString()` 方法中的成员。       按住 `Shift` (Windows), `Shift` (macOS), `Shift` (IntelliJ IDEA Classic (macOS)), `Shift` (macOS System Shortcuts), `Shift` (XWin), `Shift` (GNOME), `Shift` (KDE), `Shift` (Emacs), `Shift` (Sublime Text), `Shift` (Sublime Text (macOS)), `Shift` (Visual Studio), `Shift` (Visual Studio (macOS)), `Shift` (NetBeans), `Shift` (Eclipse), `Shift` (Eclipse (macOS)) 以选择多个成员。     |
|  插入 @Override  |  如果选中此复选框，则生成的代码会添加注解  `@Override` 。  |
|  OK  |  点击此按钮以生成  `toString()` 方法，并使用指定的设置关闭对话框。  |
|  无选择  |  点击此按钮生成仅包含方法声明和返回语句的  `toString()`  方法。  |
|  取消  |  点击此按钮放弃所有更改并关闭对话框。  |

## 运作方式

* [生成 toString()](generating-code.html#generate-tostring)

