A sequence diagram shows one particular creation event. The new Player lifeline begins at that event, and the creation message shows the actual arguments.
Inside a controller method, use the two-parameter Player contract shown in the class-diagram lesson.
Player jordan = new Player("Jordan", 7);The controller supplies Jordan and 7. The constructor stores those inputs in the new Player. When creation completes, jordan receives a reference to that same instance. The constructor body does not contain a return statement returning the Player.
controller : Controller lifeline in Violet.jordan : Player so its heading begins where the creation message arrives.new Player("Jordan", 7). Show the constructor activation.The class diagram uses formal parameters such as name and jerseyNumber. This sequence uses the actual arguments Jordan and 7. A different creation call changes those values without changing the constructor signature.