Notice that in this class diagram, the constructors do not have a return type. All other methods besides constructors must have return types. Here is a code segment of the class that shows its constructors and
The UML class diagram of Fig. 3.12 models classGradeBookof Fig. 3.10, which has a constructor that has anameparameter of typeString. 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, ...