Question

In C++, a base class pointer holds the address of a derived class object. The base class declares a non-virtual member function that the derived class redefines (not overrides) with the same signature. When this function is called through the base class pointer, which version executes?

A The derived class's version executes, because C++ always resolves member function calls based on the object's actual runtime type
B A compile-time error occurs, because redefining a non-virtual function in a derived class without the override keyword is prohibited
C The base class's version executes, because calls to non-virtual functions are resolved at compile time using the pointer's static, declared type
D The behavior is undefined, because mixing virtual and non-virtual function semantics through a base pointer violates the C++ standard
E The derived class's version executes, but only if the base class function was declared inline; otherwise the base version runs
Practice Next

Hey! Ask a query

🎓
Think You're Ready for RBI Grade B?
RBI Grade B 2026 Phase 1 Memory Based Paper
  • 200 Questions with Detailed Solutions
  • Section-wise Coverage (GA, English, Quant & Reasoning)