Jump to

v04-l2-checkAssert

What assertion concerning the following implementation is false ?

class Boogie {
protected:
    int n;
public:
    void dance(double time);
};

class Woogie : public Boogie {
public:
    int m;
    void dance();
};

???

Since the dance method in the Woogie class does not have the same signature as the dance method in the parent class, it is not the same method, hence not a redefinition but rather an overloading & shadowing.

🔔 In particular, since Woogie::dance() shadows Boogie::dance(double), it means that using an object Woogie obj;, we cannot do a call like obj.double(1.0)