#include
using namespace std;
class A
{
public:
virtual void show()
{
cout<<“a”<<endl;
}
};
class B:public A
{
private:
void show()
{
cout<<“b”<<endl;
}
};
int main()
{
B y;
y.show();
A *ref=&y;
ref->show();
return 0;
}
As B::show() is private this program should give an error but the output is b.How?