In C++, to ensure that a derived class does not override a method of a base class, the method in the base class should be declared as _______.
- final
- constant
- private
- static
In C++, when a base class wants to prevent its method from being overridden in the derived classes, it declares that method as final. This ensures that the method retains its original functionality without any modifications.
Loading...
Related Quiz
- What is the primary purpose of operator overloading in C++?
- In C++20, using enum with _______ allows specifying the underlying type and scope.
- In C++, the method used to allocate memory dynamically during runtime within the object is called _______.
- In a financial application, you are processing transaction data in a loop. When a fraudulent transaction is detected, it needs to be logged and then the processing needs to continue with the next transaction. How would the continue statement be utilized effectively in this scenario?
- Which of the following smart pointers does not take ownership of the pointed object?