Professional Documents
Culture Documents
Chapter 6 Object Oriented Concepts
Chapter 6 Object Oriented Concepts
CHAPTER – 6
OBJECT ORIENTED CONCEPTS
Introduction:
Programming approaches are of 3 types:
1. Procedural Programming
2. Structural Programming
3. Modular Programming
4. Object-Oriented Programming
1. Procedural Programming:
This programming gives more important to step by step procedure called algorithm
It focuses on the sequential instructions to perform a specific task.
2. Structural Programming:
It is an organized approach for programming.
It uses the basic control statements/ structural such as sequence, selection & Iteration
Sequence:
It is a simple construct statement in a program in an order from the beginning to the end.
Selection:
It executes certain set of statements based on some condition.
Iteration:
It is used to repeat the execution of a set of statements again and again until the condition
is satisfied.
3. Modular Programming:
Dividing the complex problems into smaller sub programs for easy handling.
Each sub problem is known as module.
4. Object Oriented Programming (OOP)
Each concept is represented as an object.
Each object will have its own data and functions.
Objects:
An object is an identifiable entity with some characteristics and behavior.
Definition:
Object Oriented Programming is a concept that combines both data and functions that
operates on that data into a single unit is called Object.
Object X Object Y
Dat Dat
a a
Functions Functions
Object Z
Dat
a
Functions
1. Objects:
Objects are the building blocks for designing progress.
An Object represents a person, place or a table of data.
An Object is a collection of data members and associated member functions.
Ex:
Object 1 : student Object 2 : Teacher
Member data Member data
Name Name
Reg No Subject
Course Course
Member functions Member functions
getdata ( ) getdata ( )
Display ( ) Display ( )
2. Classes:
A Class is a collection of group of objects which share common properties and
relationships or common behaviour.
Ex: Class Objects – Flowers
Rose
Lily
Lotus etc
Ex: Class Objects – Solar Systems
Sun
Moon
Earth
Mars
Jupiter etc
3. Modularity:
The process of dividing the complex problems into smaller sub problems for easy
handling is called modularity.
Each sub programs are called modules.
4. Data Abstraction:
The process of representing the essential features without including the
background details or explanations is called Data Abstraction.
Ex: In mobile phone, the features such as wifi, Bluetooth and camera etc., are
essential features and how it works are the background details.
5. Data Encapsulations:
The mechanism of combining the data and functions into a single unit is called
Data Encapsulation.
Data Encapsulation enables data hiding or information hiding.
Object
Data
Methods
Data hiding:
The concept of providing security to the data from direct access by the program
is called as Data hiding. It prevents unauthorized access of data.
6. Inheritance:
The mechanism by which one class acquires the properties and behavior from an
existing class is called Inheritance.
The existing class is a base class or super class.
The new class is referred to as derived class or sub class.
Ex:
7. Polymorphism:
Polymorphism is the ability of an operator or function to be processed in more than
one form.
Example:
Draw ( )
***************