Inheritance

Ruby Programming – Inheritance in Ruby

Inheritance is one of the great feature in Object Oriented Programming. Ruby supports inheritance. Inheritance allows to inherit the features of the base classes to its derived classes. That means, through derived class objects we can access the features of the base class. Through this Article, we will discuss how we use Inheritance in Ruby. […]

C++ – Inheritance – to extend class

Inheritance allows reusing the functionality. Inheritance inherits base class members to its derived class. We can use base class members within the derived class without rewriting the base class code. C++ allows single inheritance as well as multiple inheritances. In single inheritance, the derived class is inherited from a single base class. In multiple inheritances, […]

C++ – Class Constructors

In C++, class constructors are special kind of methods to instantiate a class. When class’s object is going to create, C++ will first call class’s constructor to initialize the class. Initialize the class means, assigning it’s members and allocating any dynamic memory etc., After class’s constructor is called, class’s object creation will be completed. Constructors […]

C++ – How to define virtual functions?

C++ is a Object Oriented language. C++ uses virtual keyword in different places. One of the use of virtual keyword is to create virtual functions. An important feature in Object Oriented programming is Polymorphism; which means multiple-behaviors. An object has multiple behaviors and it shows particular behavior depending on its context. C++ achieves this with […]

Scroll to top