Computer Science, asked by payaljindal2058, 11 months ago

When a derived class inherits a base class privately?

Answers

Answered by simran7539
7

Answer:

With private inheritance, public and protected member of the base class become private members of the derived class. That means the methods of the base class do not become the public interface of the derived object. However, they can be used inside the member functions of the derived class.

Answered by mahinderjeetkaur878
1

Answer: - With private inheritance, the public as well as the protected member of the base class become the private members of the derived class. That means that the methods of the base class do not become the public interface of the derived object class.

Correct question: -

Q. What happens when a derived class inherits a base class privately?

Answer: -

With private inheritance, the public aa well as the protected member of the base class become the private members of the derived class. That means that the methods of the base class do not become the public interface of the derived object class.

About Inheritance of the class: -

  • The ability of the class to derive the properties as well as the characteristics from another class is called Inheritance.
  • Inheritance is the most important features of the Object-Oriented Programming language.
  • Inheritance is a feature or is a process in which a new class is created from an existing class.
  • The new class created is then called as the “derived class” or as the “child class” and the existing class is called as the “base class” or as the “parent class”.
  • When we say that the derived class inherits the base class, then we mean to say that the derived class inherits all the properties of the base class but without changing the properties of base class and even can add new features to its own class.

To know more about the topic, visit the below links: -

https://brainly.in/question/35746452

https://brainly.in/question/38838972

#SPJ3

Similar questions