Adding fields to Java classes and interfaces

You can use Unified Modeling Language (UML) class diagrams to add fields to Java™ classes and interfaces.

To add a field to a Java class or interface:
  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.
Note: You can also use the action bar to add fields to Java classes and interfaces.
Related concepts
Classes
Classifiers
Attributes
Related tasks
Modifying Java classes or interfaces
Adding methods to Java classes and interfaces
Feedback
(C) Copyright IBM Corporation 2000, 2005. All Rights Reserved.