Question: What is the output when Q 2 ( ) is invoked? class Q 1 class { private: Int myPrivateInt; public: Q 1 class ( int
What is the output when Q is invoked?
class Qclass
private:
Int myPrivateInt;
public:
Qclassint x
myPrivateInt x;
QClass myPrivateInt ;
void add int x;
int getVal return myPrivateInt;
void decrement int i myPrivateInt i;
;
void Q
Qclass q;
int y qmyPrivateInt;
cout y y;
Group of answer choices
Division by zero exception
Compilation error due to accessing a private member
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
