Closed tjwjoe closed 3 years ago
In this question from a quiz, the code creates the new Member objects with the variable names adam, ben and charlie, yet the Object Diagram omits their names. Is this allowed? I thought that omission of the object names means that the object is actually lacking of a name.
That's not a strict rule. In this case, it's clear which object is which (based on the name
attribute). Not much value added by using object names.
In this question from a quiz, the code creates the new Member objects with the variable names adam, ben and charlie, yet the Object Diagram omits their names. Is this allowed? I thought that omission of the object names means that the object is actually lacking of a name. For example in
TestObj A = new TestObj(new B())
, the new object B would be an unnamed object. I feel like this might introduce ambiguity if omission of the variable names are allowed when they are named.