class A { private: int x, y; public: A() { x = y = 0; } void inc() { x++; y++; } void print() { cout << x << " " << y << endl; } }; int main() { A z1, z2; z1.print(); z2.print(); // print 0's z1.inc(); z1.inc(); z2.inc(); z1.print(); z2.print(); // print 2's for z1, 1's for z2. z1.x = 0; // error, x is private return ; }