# Add new field or constant

> **TL;DR**
> `UML Class diagram - Context menu of a node element | New | Field`
>
>
>
> `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` (NetBeans), `Alt+Insert` (Visual Studio), `⌘ ⌃ N` (Visual Studio (macOS)), `Alt+Insert` (Eclipse), `⌘ N` (Eclipse (macOS))
>
>
>
> For more information about working with diagrams, refer to [UML class diagrams](class-diagram.html).

| Item | Description |
| --- | --- |
| Visibility | Select the desired visibility modifier. |
| Type | Specify the type of the new field. Note that [code completion](auto-completing-code.html) works here. As you type, the suggestion list shrinks to show the matching options. Non-existent type is marked as a syntax error.   |
| Name | Specify the name of the new field. |
| Initializer |  Specify the initial value of the new field. Note that such value should correspond to the declared type. For example, if the type is String, the suggested initializer should be enclosed in quotes.      Note that [code completion](auto-completing-code.html) works here. As you type, the suggestion list shrinks to show the matching options. Non-existent type is marked as a syntax error.      |
| Static | Add `static` to the field declaration. |
| Final | Add `final` to the field declaration. |
| Preview | This read-only area shows the draft declaration as you fill in the dialog fields.  |

## See also

### Procedures

[Add new members to a class](class-diagram.html#add_members)

### Reference

[Class diagram toolbar, context menu, and legend](class-diagram-toolbar-and-context-menu.html)

