Hi,
Why we get 22?
I think it's due to
polymorphism but I'm not 100% sure.
My understanding is, when "bogo(new Extension())" is called, it will use the void add() that belongs to Extension class i.e. void add(int v) { i += v*2; } and it won't use the one in Base class which is void add(int v) { i += v; } because the Extension class method has overridden its parent/superclass method.
I hope that's the correct answer.
