This example shows the Class myClass that has Operation myClass(), which is the constructor, and Operation ~myClass(), which is the destructor.
Example Constructor and Destructor in the Class diagram
The Constructor and the Destructor operations.
To create a Constructor
- Create a Class with an Operation.
- Go to the Class Specification window.
- Select Operation
- Apply the stereotype «C++Constructor» for Operation.
To create a Destructor
- Create a Class with an Operation.
- Go to the Class Specification window.
- Select Operation
- Apply the stereotype «C++Destructor» for Operation.