सीधे मुख्य सामग्री पर जाएं

संदेश

2022 की पोस्ट दिखाई जा रही हैं

We will discuss the inheritence in this blog.

                                In this blog we will learn       what is inheritence and we will also learn how to   use. this is my code which we have to run in the compiler so go to your  compiler and run this program and check this........ // C++ program to demonstrate inheritance #include <iostream> using namespace std; // base class class Animal {    public:     void eat() {         cout << "I can eat!" << endl;     }     void sleep() {         cout << "I can sleep!" << endl;     } }; // derived class class Dog : public Animal {      public:     void bark() { ...