Inheritance:: Operator Overloading
Inheritance:: Operator Overloading
Inheritance:: Operator Overloading
The exiting operator such as:- (+,-,*,/,) can be used with inbuild data type such as float, int, double etc.
but they can’t operate on user defined data type for example :- class
The process of redefining the meaning of the existing operator while using with user defined data type is
called operator overloading.
If we redefine operator (+) for adding to complex number or complex object then it can be written as:
a. Class complex:
Following are the operator that can be overloaded in c++
1. Member access operator (.)
2. Scope resurrection operator
3. Conditional operator or (?:)
4. Size of ()
Inheritance:
C++ supports the concept the reuse ability. C++ classes can be
reuse again & again by the programmer
This can be achieved by creating new classes by existing one. The
process of creating a new class from the existing one is called
inheritance.
Base and derived class:
The existing class is called base class or parent class or sometime
it is called as super class and the new class creating from the
existing one is called derived class or child class or sub class.
Feature A
Feature A
Feature B
Feature C
The column after the derived claas name declared the indicates that the new class
careted from the existing one. Here visibility mode specify either public or
protected or private.