Problems with classes (super new)
- by user260036
Hi, I've problems to figure it out what's happening in the following exercise, I'm learning Smalltalk, so I'm newbie.
Class Anew
^super new initialize.
Ainitialize
a:=0.
Class Bnew: aParameter
|instance|
instance := super new.
instance b: instance a + aParameter.
^instance
Binitialize
b:=0.
The problem says what happen when the following code is executed:
B new:10.
But I can't not figure it out why instance variable does not belong to A class.
Thanks