IntelliJ IDEA 2018.1 Help

Add New Field or Constant

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


ItemDescription
VisibilityFrom this drop-down list, select the desired visibility modifier.
TypeSpecify 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.
NameSpecify the name of the new field.
InitializerSpecify 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.

StaticSelect this checkbox to add static to the field declaration.
FinalSelect this checkbox to add final to the field declaration.
PreviewThis read-only area shows the draft declaration as you fill in the dialog fields.
Last modified: 24 July 2018

See Also