nus-cs2103-AY2324S2 / forum

16 stars 0 forks source link

Verification of quiz answer #1030

Closed cheahTJ closed 5 months ago

cheahTJ commented 5 months ago

The method m2 should belong to the Foo class right? Just making sure there is no lapse in my understanding.

Screenshot 2024-04-26 at 12 12 12 PM

cheahTJ commented 5 months ago

I think I have got it, the method m2 should belong to the Bar class as can be seen from the sequence diagram above, the 'control' is being passed to theBar` class. Is this understanding correct?

yashpola commented 5 months ago

@cheahTJ

Yes I think the f:Foo object is calling the m2 method of the b:Bar object. So m2 belongs to Bar