|
The instance variables (properties) in a class can
be manipulated using the Properties Dialog of the desired class.
- Double click the class in the class diagram.
- Select the "Variables" tab.
- Click on "New" to create a new variable or
select the desired existing variable.
- The variable type can be typed in or selected
from the drop list.
- Click on the "Initial Value" tab to set the
default value for the variable.
- Type in the initialization code without either the "=" sign or the
ending semicolon, e.g.:
new Rectangle(5,17) (to initialize to
a new object
instance) or 56.294 (to initialize to a specific primitive value)
- Click on the "Comment" tab to write a
description of the variable.
- Select the proper scoping ( package, public,
protected, private) and whether the variable is static, final, etc from
the radio button choices.
- If an accessor method is desired for this variable, select the "Properties" tab and then if a "get"
and/or "set" routine is desired. SB will automatically generate the accessor
method.
|