# 创建新方法

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

> **TL;DR**
> 必需插件： [UML](managing-plugins.html)
>
>
>
> 访问：  `UML 类图 - 节点元素的上下文菜单 | 新建 | 方法`
>
>
>
> `Alt+Insert` (Windows), `⌘ N` (macOS), `⌃ N` (IntelliJ IDEA Classic (macOS)), `⌘ N` (macOS System Shortcuts), `Alt+Insert` (XWin), `Alt+Insert` (GNOME), `Alt+Insert` (KDE), `Alt+Insert` (Emacs), `Alt+Insert` (Sublime Text), `⌘ N` (Sublime Text (macOS)), `Alt+Insert` (Visual Studio), `⌘ ⌃ N` (Visual Studio (macOS)), `Alt+Insert` (NetBeans), `Alt+Insert` (Eclipse), `⌘ N` (Eclipse (macOS))
>
>
>
> 有关操作信息，请参考 [UML 类图](class-diagram.html)

|  条目  |  描述  |
| --- | --- |
|  名称  |  使用此字段修改方法名称。  |
|  返回值类型  |  使用此字段修改方法返回值类型。    [代码补全](auto-completing-code.html) `Ctrl+Space` (Windows), `⌃ Space` (macOS), `⌃ Space` (IntelliJ IDEA Classic (macOS)), `⌃ Space` (macOS System Shortcuts), `Ctrl+Space` (XWin), `Ctrl+Space` (GNOME), `Ctrl+Space` (KDE), `Alt+/` (Emacs), `Ctrl+Space` (Sublime Text), `⌃ Space` (Sublime Text (macOS)), `Ctrl+Space` (Visual Studio), `⌃ Space` (Visual Studio (macOS)), `Ctrl+Space` (NetBeans), `Ctrl+Space` (Eclipse), `⌃ Space` (Eclipse (macOS)) 在此字段中可用，   类型   列中的   参数   区域，以及   例外   区域的异常类型列表中。     |
|  参数  |
|  类型  |  指定参数类型。    请注意， [代码补全](auto-completing-code.html) 在此处有效。 当您输入时，建议列表会缩小显示匹配的选项。 不存在的类型被标记为语法错误。     |
|  名称  |  指定参数名称。  |
|  添加/移除  |  使用这些按钮添加或删除参数。  |
|  上移/下移  |  使用这些按钮通过在参数列表中上下移动它们来重新排序参数。  |
|  可见性  |  选择一个选项来更改方法的可见性范围。  |
|  抽象  |  如果选中此复选框，  `abstract`  修饰符将添加到方法签名中。  |
|  例外  |
|  添加/移除  |  使用这些按钮来添加/删除方法抛出的异常。 对于每一个新的异常，指定其类型。  |
|  上移/下移  |  使用这些按钮通过在列表中向上或向下移动来重新排列异常。  |
|  签名预览  |  这个只读区域在您填写对话框字段时显示草稿方法签名。  |

## See also

### 过程

[将新成员添加到类中](class-diagram.html#add_members)

### 参考

[类图工具栏、上下文菜单和图例](class-diagram-toolbar-and-context-menu.html)

