The role of the override statement is very simple, that is, when you rewrite a member function inherited from the parent class for a subclass, if the rewriting fails for various reasons (there are many reasons for failure, such as incorrect parameter types, missing function modifiers Etc.), will give you a clear prompt when compiling.
Shorthand
- Add an override statement after the function intended to be rewritten
- Member function lvalue reference modifiers (&) and rvalue reference modifiers (&&) can distinguish between lvalue objects and rvalue objects (*this).