lass first { public: void setX(); void print() const; protected: int y; void setY(int a); private: int x; }; Suppose that class second is derived from class first using the statement: class second: private first Determine which members of class first are private, protected, and public in class second.
OOPs
In today's technology-driven world, computer programming skills are in high demand. The object-oriented programming (OOP) approach is very much useful while designing and maintaining software programs. Object-oriented programming (OOP) is a basic programming paradigm that almost every developer has used at some stage in their career.
Constructor
The easiest way to think of a constructor in object-oriented programming (OOP) languages is:
class first { public: void setX(); void print() const;
protected: int y; void setY(int a);
private: int x; };
Suppose that class second is derived from class first using the statement: class second: private first
Determine which members of class first are private, protected, and public in class second.
Step by step
Solved in 3 steps with 2 images