and events can all be overridden. Non-virtual or static methods cannot be overridden. The overridden base method must be virtual, abstract, or override. In addition to the modifiers that are used for method overriding, C# allows the hiding of an inherited property or method. This is done using the same signature of a property or method but adding the modifier in front of it. In the above example, hiding causes the following: Cat cat = new Cat(); cat.Name = …; // accesses Cat.Name cat.Eat(); // calls Cat.Eat() cat.Go(); // calls Cat.Go() ((Animal)cat).Name = …; // accesses Animal.Name! ((Animal)cat).Eat(); // calls Cat.Eat()! ((Animal)cat).Go(); // calls Animal.Go()! C++ C++ does not have the keyword that a subclass can use in Java to invoke a superclass version of a method that it wants to override. Instead, the name of the parent or base class is used followed by the scope resolution operator. For example, the following code presents two classes, the base class , and the derived class . overrides the class's method, so as also to print its height. #include <iostream> //--------------------------------------------------------------------------- class Rectangle { public: Rectangle(double l, double w) : length_(l), width_(w) {} virtual void Print() const; private: double length_; double width_; }; //--------------------------------------------------------------------------- void Rectangle::Print() const { // Print method of base class. std::cout << "Length = " << length_ << "; Width = " << width_; } //--------------------------------------------------------------------------- class Box : public Rectangle { public: Box(double l, double w, double h) : Rectangle(l, w), height_(h) {} void Print() const override; private: double height_; }; //--------------------------------------------------------------------------- // Print method of derived class. void Box::Print() const { // Invoke parent Print method. Rectangle::Print(); std::cout << "; Height = " << height_; } The method in class , by invoking the parent version of method , is also able to output the private variables and of the base class. Otherwise, these variables are inaccessible to . The following statements will instantiate objects of type and , and call their respective methods: int main(int argc, char** argv) { Rectangle rectangle(5.0, 3.0); // Outputs: Length = 5.0; Width = 3.0 rectangle.Print(); Box box(6.0, 5.0, 4.0); // The pointer to the most overridden method in the vtable in on Box::print, // but this call does not illustrate overriding. box.Print(); // This call illustrates overriding. // outputs: Length = 6.0; Width = 5.0; Height= 4.0 static_cast<Rectangle&>(box).Print(); } In C++11, similar to Java, a method that is