Company: ICICI_MCQ
Difficulty: medium
John is working with reference variables in ABAP Objects and wants to know which method is executed when calling a method using a reference variable that refers to an object of a subclass. Which method will be invoked in this situation? The method redefined in the superclass. The method redefined in the subclass. Both the superclass method and the subclass method are executed. The method specified in the reference variable declaration. What is the output of the following C++ code for inputs 2 and 3 respectively? #include <iostream> #include <cmath> using namespace std; class hack_calc { private: int x, y, z; public: void add() { cin>>x>>y; z = pow(x, y); z = z + pow(z, x); z = z / y + 10; cout<<z<<endl; } }; int main() { hack_calc sm; sm.add(); return 0; } 27 12 34 Runtime Error Alice is an ABAP Objects programmer. She is attempting to understand the significance of visibility sections. What benefit do these parts provide regarding understanding and