SlideShare a Scribd company logo
5
Most read
6
Most read
7
Most read
C++
Object Oriented Programming Language
Basic Concepts of OOP
 Objects
 Classes
 Data Abstraction & Data Encapsulation
 Inheritance
 Polymorphism
 Dynamic Binding
 Message Passing
 Objects
 Objects are runtime entities in object oriented system. Objects may person, place,
bank account that the program has to handle the following is a fig to represent an
object.
Object : student
Data :
rollno
name
Function :
getdata()
putdata()
In above fig object student has two data members rollno and name and two member
function getdata() and putdata()
Objects are variables of type class once class has been defined we can create
any number of objects belonging to that class programming language problem is
divided into objects program object are chosen such that they match closely with
real world object.
 Class
 Objects contain data and function. The entire set of data and function are
made user defined data type with the help of class.
Class is a collection of similar objects once class has been defined we can
create any number of objects belonging to that class classes are user defined
data types.
e.g.
I. Class game contains objects like cricket, chess, badminton etc
II. Class fruit contains objects like mango, apple, orange, banana etc
 Data Abstraction and Data
Encapsulation
 The wrapping up of data and function into single unit is called data
encapsulation. The data is not accessible to the outside world it is accessible
to those functions that are wrapped in class. This functions provide the
interface between object data and program. This insulation of data from
direct access of program is called data hiding or information hiding.
 Data Abstraction means representing essential features without including
details. Classes uses the concept of abstraction it is a list of abstract
attributes such as size, weight, cost and function cooperate on it the
attributes are called data members and the function that operate on it are
called methods or member functions this concept of data abstraction used by
the classes are also known as ADT (Abstract Data Type).
 Inheritance
 It is a process by which objects of one class aquires the properties of object
of another class.
In OOP class is divided into subclasses. Original class is called base class or
super class and other classes can be defined that share its characteristics and
add their own is called derived class or sub class
for e.g.
vehicle class is derived into cars, trucks, buses, etc
In OOP concepts inheritance provided reusability.
 Polymorphism
 It means ability to take more than one for an operation may have different
behaviours in a different instances
e.g.
A single function name can be used to handle different type of argument
using single function name to perform different type of tasks is known as
function overloading
 Dynamic Binding
 Binding means linking a procedure call to the code to be executed in response
to a procedure call dynamic binding is also called late binding. It means code
associated with given procedure call is not known until the time of call at run
time.
 Message Passing
 An OOP program consists of set of object that communicate with each other
the process of programming OOP involves steps like
I. Creating a classes that define objects and their behaviours.
II. Creating object from class definition.
III. Establishing communication among objects.
e.g.
object A is communicating with object B.
Basic C++ Program
 #include<iostream.h>
#include<conio.h>
class student
{
int rollno;
char nm[10];
public:
void getdata();
void putdata();
};
Basic C++ Program
void student : : getdata()
{
cout<<“Enter roll no “<<endl;
cin>>rollno;
cout<<“Enter name”<<endl;
cin>>nm;
}
Basic C++ Program
void student : : putdata()
{
cout<<“Roll no is = “<<rollno;
cout<<“Name = “<<nm;
}
void main()
{
student s;
clrscr();
s.getdata();
s.putdata();
getch();
}

More Related Content

PPT
C plusplus
PPT
Object Oriented Language
PPTX
C++ with student management system project
PPT
Lecture 4
PPTX
concept of oops
PPTX
Oops concept in c++ unit 3 -topic 4
PPTX
Basic concept of oops
PDF
M.c.a. (sem iv)- java programming
C plusplus
Object Oriented Language
C++ with student management system project
Lecture 4
concept of oops
Oops concept in c++ unit 3 -topic 4
Basic concept of oops
M.c.a. (sem iv)- java programming

What's hot (20)

PPT
General OOP concept [by-Digvijay]
PPTX
object oriented programing lecture 1
PPT
Lecture 2
PPTX
Object oriented programming concepts
PPT
PPTX
Encapsulation
PPT
Object Oriented Programming Concepts using Java
PPTX
principle of oop’s in cpp
PDF
Oop concepts classes_objects
PPTX
Encapsulation of operations, methods & persistence
PPTX
Object oriented programming concept
PPTX
Object Oriented Concept
PPTX
Introduction to Object Oriented Programming
PDF
Java Programming Paradigms Chapter 1
PPTX
Characteristics of oop
PPTX
Oops concepts
PPT
Oops slide
General OOP concept [by-Digvijay]
object oriented programing lecture 1
Lecture 2
Object oriented programming concepts
Encapsulation
Object Oriented Programming Concepts using Java
principle of oop’s in cpp
Oop concepts classes_objects
Encapsulation of operations, methods & persistence
Object oriented programming concept
Object Oriented Concept
Introduction to Object Oriented Programming
Java Programming Paradigms Chapter 1
Characteristics of oop
Oops concepts
Oops slide
Ad

Similar to Object oriented programming C++ (20)

PPTX
Object Oriented Programming Concepts Using C++
PPTX
CPP_,module2_1.pptx
PPTX
1.1-Introduction to Object oriented.pptx
PPT
chapter - 1.ppt
PPTX
Principles of oop
PDF
Object oriented concepts
PPTX
Ch 1 Introduction to Object Oriented Programming.pptx
DOC
Introduction to OOPs Concept- Features, Basic concepts, Benefits and Applicat...
PPTX
Object oriented programming 6 oop with c++
PPTX
POP vs OOP Introduction
PPTX
SE-IT JAVA LAB OOP CONCEPT
PPT
Basic concept of OOP's
PPTX
Chapter 04 object oriented programming
PPTX
chapterOne.pptxFSdgfqdzwwfagxgghvkjljhcxCZZXvcbx
PPTX
PPTX
Chapter - 1.pptx
PDF
L1-Introduction to OOPs concepts.pdf
PPTX
IET307 OOP - object oriented programming concepts.pptx
PPTX
2-oops-concepts_about_c++_btech_cse.pptx
PDF
C++ chapter 1
Object Oriented Programming Concepts Using C++
CPP_,module2_1.pptx
1.1-Introduction to Object oriented.pptx
chapter - 1.ppt
Principles of oop
Object oriented concepts
Ch 1 Introduction to Object Oriented Programming.pptx
Introduction to OOPs Concept- Features, Basic concepts, Benefits and Applicat...
Object oriented programming 6 oop with c++
POP vs OOP Introduction
SE-IT JAVA LAB OOP CONCEPT
Basic concept of OOP's
Chapter 04 object oriented programming
chapterOne.pptxFSdgfqdzwwfagxgghvkjljhcxCZZXvcbx
Chapter - 1.pptx
L1-Introduction to OOPs concepts.pdf
IET307 OOP - object oriented programming concepts.pptx
2-oops-concepts_about_c++_btech_cse.pptx
C++ chapter 1
Ad

Recently uploaded (20)

PDF
O7-L3 Supply Chain Operations - ICLT Program
PDF
Saundersa Comprehensive Review for the NCLEX-RN Examination.pdf
PDF
Complications of Minimal Access Surgery at WLH
PDF
STATICS OF THE RIGID BODIES Hibbelers.pdf
PPTX
human mycosis Human fungal infections are called human mycosis..pptx
PPTX
Presentation on HIE in infants and its manifestations
PPTX
school management -TNTEU- B.Ed., Semester II Unit 1.pptx
PDF
Abdominal Access Techniques with Prof. Dr. R K Mishra
PDF
VCE English Exam - Section C Student Revision Booklet
PPTX
Microbial diseases, their pathogenesis and prophylaxis
PDF
2.FourierTransform-ShortQuestionswithAnswers.pdf
PPTX
master seminar digital applications in india
PDF
102 student loan defaulters named and shamed – Is someone you know on the list?
PDF
ANTIBIOTICS.pptx.pdf………………… xxxxxxxxxxxxx
PDF
Module 4: Burden of Disease Tutorial Slides S2 2025
PDF
OBE - B.A.(HON'S) IN INTERIOR ARCHITECTURE -Ar.MOHIUDDIN.pdf
PDF
RMMM.pdf make it easy to upload and study
PPTX
Pharma ospi slides which help in ospi learning
PPTX
202450812 BayCHI UCSC-SV 20250812 v17.pptx
PPTX
Institutional Correction lecture only . . .
O7-L3 Supply Chain Operations - ICLT Program
Saundersa Comprehensive Review for the NCLEX-RN Examination.pdf
Complications of Minimal Access Surgery at WLH
STATICS OF THE RIGID BODIES Hibbelers.pdf
human mycosis Human fungal infections are called human mycosis..pptx
Presentation on HIE in infants and its manifestations
school management -TNTEU- B.Ed., Semester II Unit 1.pptx
Abdominal Access Techniques with Prof. Dr. R K Mishra
VCE English Exam - Section C Student Revision Booklet
Microbial diseases, their pathogenesis and prophylaxis
2.FourierTransform-ShortQuestionswithAnswers.pdf
master seminar digital applications in india
102 student loan defaulters named and shamed – Is someone you know on the list?
ANTIBIOTICS.pptx.pdf………………… xxxxxxxxxxxxx
Module 4: Burden of Disease Tutorial Slides S2 2025
OBE - B.A.(HON'S) IN INTERIOR ARCHITECTURE -Ar.MOHIUDDIN.pdf
RMMM.pdf make it easy to upload and study
Pharma ospi slides which help in ospi learning
202450812 BayCHI UCSC-SV 20250812 v17.pptx
Institutional Correction lecture only . . .

Object oriented programming C++

  • 2. Basic Concepts of OOP  Objects  Classes  Data Abstraction & Data Encapsulation  Inheritance  Polymorphism  Dynamic Binding  Message Passing
  • 3.  Objects  Objects are runtime entities in object oriented system. Objects may person, place, bank account that the program has to handle the following is a fig to represent an object. Object : student Data : rollno name Function : getdata() putdata() In above fig object student has two data members rollno and name and two member function getdata() and putdata()
  • 4. Objects are variables of type class once class has been defined we can create any number of objects belonging to that class programming language problem is divided into objects program object are chosen such that they match closely with real world object.
  • 5.  Class  Objects contain data and function. The entire set of data and function are made user defined data type with the help of class. Class is a collection of similar objects once class has been defined we can create any number of objects belonging to that class classes are user defined data types. e.g. I. Class game contains objects like cricket, chess, badminton etc II. Class fruit contains objects like mango, apple, orange, banana etc
  • 6.  Data Abstraction and Data Encapsulation  The wrapping up of data and function into single unit is called data encapsulation. The data is not accessible to the outside world it is accessible to those functions that are wrapped in class. This functions provide the interface between object data and program. This insulation of data from direct access of program is called data hiding or information hiding.  Data Abstraction means representing essential features without including details. Classes uses the concept of abstraction it is a list of abstract attributes such as size, weight, cost and function cooperate on it the attributes are called data members and the function that operate on it are called methods or member functions this concept of data abstraction used by the classes are also known as ADT (Abstract Data Type).
  • 7.  Inheritance  It is a process by which objects of one class aquires the properties of object of another class. In OOP class is divided into subclasses. Original class is called base class or super class and other classes can be defined that share its characteristics and add their own is called derived class or sub class for e.g. vehicle class is derived into cars, trucks, buses, etc In OOP concepts inheritance provided reusability.
  • 8.  Polymorphism  It means ability to take more than one for an operation may have different behaviours in a different instances e.g. A single function name can be used to handle different type of argument using single function name to perform different type of tasks is known as function overloading
  • 9.  Dynamic Binding  Binding means linking a procedure call to the code to be executed in response to a procedure call dynamic binding is also called late binding. It means code associated with given procedure call is not known until the time of call at run time.
  • 10.  Message Passing  An OOP program consists of set of object that communicate with each other the process of programming OOP involves steps like I. Creating a classes that define objects and their behaviours. II. Creating object from class definition. III. Establishing communication among objects. e.g. object A is communicating with object B.
  • 11. Basic C++ Program  #include<iostream.h> #include<conio.h> class student { int rollno; char nm[10]; public: void getdata(); void putdata(); };
  • 12. Basic C++ Program void student : : getdata() { cout<<“Enter roll no “<<endl; cin>>rollno; cout<<“Enter name”<<endl; cin>>nm; }
  • 13. Basic C++ Program void student : : putdata() { cout<<“Roll no is = “<<rollno; cout<<“Name = “<<nm; } void main() { student s; clrscr(); s.getdata(); s.putdata(); getch(); }