The UML class diagram of Fig. 3.8 models the GradeBook
class of Fig. 3.7, which has a constructor with a name
parameter of type string
(represented by type String
in the UML). Like operations, the UML models constructors in the third compartment of a class in a class diagram. To distinguish a constructor from a class’s operations, the UML places the word “constructor” between guillemets (« and ») before the constructor’s name. By convention, you list the class’s constructor before other operations in the third compartment.
Fig. 3.8. UML class diagram indicating that class GradeBook has a constructor with a name parameter of UML type String.
3.17.78.157