Initialize data members in the constructor
- Last Updated: May 24, 2019
- 1 minute read
- OpenEdge
- Version 13.0
- Documentation
Here is part of the constructor for the Dept class. It
takes values from the parameters to the constructor and uses them to set the values of
the data members of the class. Once this instance has been created, it is available for
adding employees and performing other behaviors of the class.
Notice that we used the this-object: prefix to allow the
editor to help us select the ExpenseCode data member name.
constructor public Dept ( input pDeptName as character, input pMaxNumEmployees as integer, input pExpenseCode as character ):
super ().
assign DeptName = pDeptName /* add code here to size the array using pMaxNumEmployees */
this-object:ExpenseCode = pExpenseCode.
end constructor.