C / C++

C++ inheritance

lets have a look at the below example: // C++ inheritance #include<iostream> using namespace std;   class Point { protected:     int x,y; public:     Point(int ,int);     void display(void); };   Point::Point(int a,int b) {     x=a;     y=b; }   void Point::display(void) {      cout<<"point = "; }   class Circle : public Point {     double radius; public:     Circle(int ,int ,double );     void display(void); };   Circle::Circle(int a,int b,double c):Point(a,b) {     radius = c; }   void Circle :: display(void) {     Point::display();     cout<<" and radius = "<<radius; }   int main(void) {     Circle c(3,4,2.5);     c.display();     cout<<endl;     return 0; } In the above we took a class “point” in which we defined its attributes (its data members...

Java

JavaFX Java GUI Tutorial – 35 – Working with Scene Builder

Facebook - GitHub - Google+ - LinkedIn - reddit - Support - thenewboston - Twitter - Source

JavaFX Java GUI Tutorial – 34 – Scene Builder

Facebook - GitHub - Google+ - LinkedIn - reddit - Support - thenewboston - Twitter - Source

Django

C Programming

STAY CONNECTED

0FansLike
65,981FollowersFollow
24,254SubscribersSubscribe

MAKE IT MODERN

LATEST REVIEWS

Simple Java inheritance example

Inheritance is one of the most powerful feature of OOP. It provides us code reusability and polymorphism. The concept is very simple and similar...