IntelliJ IDEA 2018.3 Help

Add New Field or Constant

UML Class diagram - Context menu of a node element | New | Field
Alt+Insert


Item

Description

Visibility

From this drop-down list, select the desired visibility modifier.

Type

Specify the type of the new field. Note that code completion 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 works here. As you type, the suggestion list shrinks to show the matching options. Non-existent type is marked as a syntax error.

Static

Select this checkbox to add static to the field declaration.

Final

Select this checkbox to add final to the field declaration.

Preview

This read-only area shows the draft declaration as you fill in the dialog fields.

Last modified: 19 December 2018

See Also