You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
data3 = data2 * getData1(); // We can't write data1 directly as it is the private member of Base Class, and so we can't inherit it. That's why we are using function to get data1.
}
void Derived :: display(){
cout << "Value of data1 is : " << getData1() << endl; // We are taking the value of Data1 from the getData1 method, because the data1 is the private member of Base class.