NEW RELEASE! The 2022x Refresh2 Hot Fix 3 was released on February 28, 2025. For more information, see 2022x Refresh2 Hot Fix 3 Version News.

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



  1. Create a Class with an Operation.
  2. Go to the Class Specification window.
  3. Select Operation
  4. Apply the stereotype «C++Constructor» for Operation.


To create a Destructor



  1. Create a Class with an Operation.
  2. Go to the Class Specification window.
  3. Select Operation
  4. Apply the stereotype «C++Destructor» for Operation.





Activity

All
Personal filters
All