Vous êtes sur la page 1sur 4

* Oop is Categorized In 4th Generation language and non-

structured.
Pointers
• Dynamic variables/objects.
• Memory allocation is decided during execution phase
Syntax : int *a;
Parts Of Pointer Variables
• Value part
• Address part
Note:
Dynamic Memory Allocation Keyword Used: - NEW
Dynamic Memory Deallocation Keyword Used: - DELETE

Inheritance : (General Concept)


It is an important property of oop language with the help of
which some or all properties/futures characteristics are transferred
from one or more classes towards (one or more classes) newly
designed classes.
Note : It provides software reusability
Types Of Inheritance
• Single Inheritance
• Multiple Inheritance
• Multi-level Inheritance
Single Inheritance
If only one class features (might be all or some) are
transferred/shifted towards a unit class only ; that will be categorized
as single inheritance

Class A

Single Inheritance
Class B

Conditions:
o No. of base classes should be one every time
o As well as no derived classes=1
Multiple Inheritance
In this type of Inheritance some or all of the futures of two or
more than two classes are being transferred towards any no. of newly
designed classes.
Class A Class B Class A Class B
Class C

Class C Multiple Inheritance Class D Class E

Conditions
o No. of base classes =>2
o No. of derived classes = any no.
Multi-level Inheritance
It is such type of Inheritance in which all of the futures are
transferred from an already derived class towards newly designed class

Class A

Class B

Class C Multi-Level Inheritance

Class D

Conditions
o At least one class should be available that is already derived
class and from that class we drive some classes
Modes Of Inheritance
• Public
• Private
• Protected
Modes Class interface Derived Outside the
(Inside the class
class)
Public

Private

Protected

General Syntax Of Inheritance:


Class derived_class_name: Mode Of Inheritance (space)
base_class_name
Example:
Class circle: public shape
Class bsse: protected bcs

Friend functions
If we want to utilize the private data items and private member
functions out side the class (i.e main of the program) we get help of
friend functions
Syntax : friend(keyword) retur_type name(arguments)
COMPOSITION:
It is an important future of oop languages, that provides the
affect of software reusability ; here we obtain the features of
base/already designed calss be declaring/passing the objects o it in the
new clas.
Objective/target: Software reusability
Software (program as whole (OR) some part of it)

POLYMORPHISM:
Poly two or more than two & Morphism form/shape
It is an Important feature/property/characteristic of oop language
with the help of which a single entity behaves differently
• Function(s)
• Function Overloading
• Function Overriding
Implementation of Polymorphism
It can be implemented with the help of function overriding
concept as well as virtual functions.
Overrided Functions
Conditions For Function Overriding:
• Two or more than two function with the same name
• Function should be resided in different classes
Note: In function overriding our focus is on the definition of the
function that we want to override (i.e the functionality should be
different)

Virtual functions:
If any function decelerator signature is attached with the
keyword of “Virtual” it will have the characteristics of Virtual
function.
Pure Virtual functions:
If any virtual function is assigned the zero value at the time of its
declaration it is called pure virtual function.
i.e. virtual void show()=o;
Abstract Class:
If any class (interface) contains at least one pure virtual function
that is know as abstract class
Properties:-
o User/programmer is not allowed to design/create he object of
that class;
Concrete Class
Any class derived/inherited form an abstract class is know as
concrete class.
Note. User can create objects within the concrete class

Vous aimerez peut-être aussi