Tag: Inheritance

C#: Classes (Part – 3)

‘C#’ class members are accessible based on its access specifiers. I will write a separate article on class’s access specifiers in more detail. But here I want to give an high level introduction on access specifiers. Access Specifiers ‘C#’ provides…

C++: Inheritance

Inheritance allows to reuse the functionality. Inheritance inherits base class members to derived class. We can use base class members within derived class without rewriting base class code. C++ allows single inheritance as well as multiple inheritance. In single inheritance, derived…

C++: Class Constructors

In C++, Class constructors are special kind of methods to instantiate a class. When class’s object is going to create, first C++ will call class’s constructor to initialize the class. Initialize the class means, assigning its members and allocating any…

C++: Why virtual? (Part-2)

An interface is a contract between a caller and a callee. An interface doesn’t provide any implementation. It provides a blue-print. C++ uses virtual keyword to create an interface or an abstract class. Lets take an example: class IHello {…