Inheritance Introduction

Sort by

recency

|

99 Discussions

|

  • + 0 comments

    This introduction provides a solid foundation for understanding inheritance, one of the core principles of object-oriented programming (OOP). It effectively explains how inheritance allows a class (subclass/child) to derive properties and behaviors from another class (superclass/parent), promoting code reusability and hierarchical organization. Ekbet Login

  • + 0 comments

    I’m working on improving my website forgotten ummah, and connecting to the correct DE org really helped me solve the challenge issue. Your steps made it super clear, and everything is working perfectly now. Thanks a lot!

  • + 0 comments

    Here is Inheritance Introduction problem solution in C++ - https://programmingoneonone.com/hackerrank-inheritance-introduction-solution-in-cpp.html

  • + 0 comments

    class Triangle{ public: void triangle(){ cout<<"I am a triangle\n"; } };

    class Isosceles : public Triangle{ public: void isosceles(){ cout<<"I am an isosceles triangle\n"; } //Write your code here. void description(){ cout<<"In an isosceles triangle two sides are equal\n"; } };

    int main(){ Isosceles isc; isc.isosceles(); isc.description(); isc.triangle(); return 0; }

  • + 0 comments
    #include <cmath>
    #include <cstdio>
    #include <vector>
    #include <iostream>
    #include <algorithm>
    using namespace std;
    
    
    class Triangle{
        public:
        	void triangle(){
         		cout<<"I am a triangle\n";
        	}
    };
    
    class Isosceles : public Triangle{
        public:
        	void isosceles(){
        		cout<<"I am an isosceles triangle\n";
        	}
      		//Write your code here.
            void description() {
                cout << "In an isosceles triangle two sides are equal\n";
            }
    };
    
    int main(){
        Isosceles isc;
        isc.isosceles();
      	isc.description();
        isc.triangle();
        return 0;
    }