Closed tankh99 closed 6 months ago
It can be split as Factory tempFactory = u.creator(); tempFactory.increase(1);
From the textbook, it seems that the else block can be ommitted.
It can be split as Factory tempFactory = u.creator(); tempFactory.increase(1);
- It's the unit class calling it since u is of type unit.
- The unit class calls it's own creator method that returns a factory
- this returned factory class calls it's own increase 1 class
From the textbook, it seems that the else block can be ommitted.
Thanks Marcus, this makes sense
I have a couple of questions regarding the sequence diagram question. I will refer to the main function as the arrows from the left:
creator().increase()
function, is it the main function calling it, or is it the factory class calling it?