Adding methods to Java classes and interfaces

You can use Unified Modeling Language (UML) class diagrams to add a method to a Java™ class or interface.

To add a method to a Java class or interface:
  1. In the diagram editor, right-click a Java class or interface; then click Add Java > Method.
  2. In the Create Java Method wizard, in the Name field, type a name for the new method.
  3. To make the method a constructor, select the Constructor check box.
  4. To throw exceptions, in the Throws field, enter an exception.
  5. Under Type and Dimensions, click a method return type and specify dimensions.
  6. Under Visibility, click a visibility style.
  7. Under Modifiers, click modifiers.
  8. Under Parameters, click a parameter type, type a name, and specify dimensions.
  9. Click Finish.
Note: You can also use the action bar to add methods to Java classes and interfaces.
Related concepts
Classes
Classifiers
Operations
Related tasks
Modifying Java classes or interfaces
Adding fields to Java classes and interfaces
Feedback
(C) Copyright IBM Corporation 2000, 2005. All Rights Reserved.