Adding fields to Java classes and interfaces in domain modeling class diagrams

You can use domain modeling class diagrams to add fields to Java classes and interfaces.

Before you begin

You must have a domain modeling class diagram with Java classes or interfaces open.

About this task

Tip: When you add fields to classes or interfaces, fully qualified names will be added for type proposals in packages if the Java Editor Code Assist's default Add import instead of qualified name preference option is cleared. Otherwise, import declarations will be added automatically.

To add a field to a Java class or interface, complete the following steps:

Procedure

  1. In the diagram editor, right-click a Java class or interface; then click Add Java > Field.
  2. In the Create Java Field wizard, in the Name field, type a name for the new field.
  3. In the Initial Value field, specify the initial value expression.
  4. Under Type and Dimensions, click a type and specify dimensions.
  5. Under Visibility, click a visibility style.
  6. Under Modifiers, click modifiers.
  7. Click Finish.

What to do next

Note: You can also use the action bar to add fields to Java classes and interfaces.

Feedback