You are on page 1of 17

A.B.N &P.R.

R COLLEGE OF
SCIENCE,KOVVUR

SUBJECT: OBJECT ORIENTED PROGRAMMING


THROUGH CPP

CLASS : IIB.COM

LECTURE 1: DELIVERED BY M.MURTHY


CHARACTERSTICS OF
PROCEDURE ORIENTED PROGRAMMING.

In procedural programming programs are


divided into a number of segments known
as subprograms. It focuses on functions
apart from the data. The sub programs
can access to the same global data, here
also the data is not fully protected.
BANKING PROJECT
Limitations of POP:-
1.Emphasis on procedure rather than data.
2.Programs are divided into no.of functions.
3.No Security for data because of global declaration. Data
move openly freely around the system.
4.It will not solve all the problems in real world.
5.It is not easy to add new data and functions to existing
code(Maintenance problem)
6.No memory management in procedure oriented languages.
7.It follows top-down approach.
OOP treats data as critical element in the program development and does
not allow it to flow freely around the system. It ties the data more closely to
the functions that operate on it.
1.Emphasis on data rather than procedure.
2.Programs are divided into no.of objects.
3. Data is hidden can’t access outside functions. Data not move freely
around the system. Data is more secure.
4. It will solve all the problems that are in real world.
5.It is very easy to add new data and functions to existing code. You can
also create new data types.
6.It follows bottom up approach.
Concepts of Object Oriented Programming :-
1.Class
2.Object
3.Data Encapsulation.
4.Data Abstraction
5.Inheritance.
6.Polymorphism
7.Dynamic binding
8.Message Passing.
Class:-

 A class is a blueprint of an object from which we will create

multiple objects of the same type. class specifies what an object

will contain and what an object will perform.

 Class is a collection of data members (Variables) and member

functions(methods).

 Class is a logical skeleton.Class has no physical existence.

 No memory is allocated for class.

 Class is a user defined data type.

 Examples:- Fruit , Vegetable, Vehicle, Human ,Animal all are

examples of class.
Object:-

 Object is a real world thing which is an instance of a class.

 Object has a physical existence.

 Memory is allocated for object.

 When you create object of a class the n some memory space is

allocated in RAM and stores non static variables of class.

 Object is a simply variable of class type.

 Example:-

 1.Mango,grapes,orange,guava all are objects of fruit class.

 2. Lion, Tiger, Elephant, Deer … examples of Animal class.


Data Encapsulation :-

 This is the most striking feature of oop. The Wrapping up of data members and

member functions into single unit is called Encapsulation.

 The data is not accessible to the outside of the world and only those functions

which are wrapped in the class can access it.

 By using class can encapsulate both data and functions.


Data Abstraction :-

I. Abstraction refers to the act of representing essential features without

including background details or explanations. Hiding internal details and

highlight the only services is called abstraction.

II. It is a technique which is used to create new data types.

III. By using Class we can create our own data types.

IV. Security, Maintainability are advantages of Data abstraction.


Inheritance:-
 Acquiring the properties from one class to another class is called inheritance (or) producing
new class from already existing class is called inheritance .
 The class which gives the properties to another class is called Parent class (or)
 Base class (or) Super class.
 The class which derives the properties from other class is called Child class (or) Derived
class (or) Sub class.
 Reusability of code is main advantage of inheritance.
 The relation between the two class is known as “is a” relation.
Polymorphism:-

 The word polymorphism came from two Greek words „poly‟ means „many‟

and „morphos‟ means „forms‟.

 Polymorphism represents the ability to take more than one form.

 Exhibiting different behaviors at different time is called Polymorphism.

 We can achieve polymorphism by using the concept of method overloading.

 Method overloading means defining more than one method with the same

name and with different arguments.

.
Dynamic Binding :-

 Linking of a procedure call to the code to be execute in response to the call is

called Binding.

 Dynamic Binding means the code associated with given procedure call to the

function code is not known until the time of the call at runtime . It is also called

late binding and Runtime binding.

 It associates with both polymorphism and Inheritance.

 By using the concept of Method overriding we can achieve this dynamic binding.
Message Passing :-

An object oriented program consists set of objects that communicate with each

other by passing messages. In this phase involves three steps.

1. create classes that define objects and their behavior

2. create objects from class definitions

3. Establish communication between objects by sending messages.

You might also like