Section 3.2.4 Account UML Class Diagram with an Instance Variable and set and get Methods

• In the UML, each class is modeled in a class diagram (p. 77) as a rectangle with three compartments. The top one contains the class’s name centered horizontally in boldface. The middle one contains the class’s attributes, which correspond to instance variables in Java. The bottom one contains the class’s operations (p. 78), which correspond to methods and constructors in Java.

• The UML represents instance variables as an attribute name, followed by a colon and the type.

• Private attributes are preceded by a minus sign () in the UML.

• The UML models operations by listing the operation name followed by a set of parentheses. A plus sign (+) in front ...

Get Java™ How To Program (Early Objects), Tenth Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.