SlideShare a Scribd company logo
1 of 28
C++ Classes Qazi Haseeb Yousaf BCS-IV ( Morning B) C.No 22 Presented By
In The Real World Life ,[object Object],[object Object],[object Object],[object Object],[object Object]
A Real World Object ATTRIBUTES BEHAVIORS
What is Data Abstraction? ,[object Object],[object Object],[object Object],[object Object],[object Object]
For Object-Orientation  ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Encapsulation ,[object Object],[object Object]
Information Hiding ,[object Object],[object Object],[object Object]
C++ Class ,[object Object],[object Object],[object Object],[object Object]
C++ Class ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
C++ Class (Syntax) ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],Don’t Forget this Semi-colon
Members of A Class ,[object Object],[object Object]
A simple class ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Access Specifiers ,[object Object],[object Object],[object Object]
Access Specifiers (contd…) ,[object Object],[object Object],[object Object],[object Object],[object Object]
Class Example ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
OBJECT ,[object Object],[object Object],[object Object],[object Object],[object Object]
[object Object]
C++ Objects
Creating Objects ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Creating an object (Syntax) ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Accessing Class Members ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Constructor ,[object Object],[object Object],[object Object]
General Syntax of Constructor ,[object Object],[object Object],[object Object]
Default Constructor: ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Copy constructor: ,[object Object]
Example (coding) ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Example (output) ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
That’s All THANKS!

More Related Content

What's hot (20)

Constructor and destructor
Constructor  and  destructor Constructor  and  destructor
Constructor and destructor
 
virtual function
virtual functionvirtual function
virtual function
 
Friend function
Friend functionFriend function
Friend function
 
Classes in c++ (OOP Presentation)
Classes in c++ (OOP Presentation)Classes in c++ (OOP Presentation)
Classes in c++ (OOP Presentation)
 
Inline function
Inline functionInline function
Inline function
 
Classes and objects
Classes and objectsClasses and objects
Classes and objects
 
Friend function in c++
Friend function in c++ Friend function in c++
Friend function in c++
 
C++ OOPS Concept
C++ OOPS ConceptC++ OOPS Concept
C++ OOPS Concept
 
Friend function & friend class
Friend function & friend classFriend function & friend class
Friend function & friend class
 
Function overloading ppt
Function overloading pptFunction overloading ppt
Function overloading ppt
 
Function overloading(c++)
Function overloading(c++)Function overloading(c++)
Function overloading(c++)
 
Templates
TemplatesTemplates
Templates
 
Constructors and Destructor in C++
Constructors and Destructor in C++Constructors and Destructor in C++
Constructors and Destructor in C++
 
Files in java
Files in javaFiles in java
Files in java
 
INLINE FUNCTION IN C++
INLINE FUNCTION IN C++INLINE FUNCTION IN C++
INLINE FUNCTION IN C++
 
Data members and member functions
Data members and member functionsData members and member functions
Data members and member functions
 
Constructor and Destructor
Constructor and DestructorConstructor and Destructor
Constructor and Destructor
 
Inheritance in c++
Inheritance in c++Inheritance in c++
Inheritance in c++
 
Virtual base class
Virtual base classVirtual base class
Virtual base class
 
Object Oriented Programming Using C++
Object Oriented Programming Using C++Object Oriented Programming Using C++
Object Oriented Programming Using C++
 

Viewers also liked

class and objects
class and objectsclass and objects
class and objectsPayel Guria
 
C++ classes tutorials
C++ classes tutorialsC++ classes tutorials
C++ classes tutorialsFALLEE31188
 
Basic concepts of object oriented programming
Basic concepts of object oriented programmingBasic concepts of object oriented programming
Basic concepts of object oriented programmingSachin Sharma
 
Classes And Objects
Classes And ObjectsClasses And Objects
Classes And Objectsrahulsahay19
 
Object Oriented Programming Concepts
Object Oriented Programming ConceptsObject Oriented Programming Concepts
Object Oriented Programming Conceptsthinkphp
 
Object oriented programming (oop) cs304 power point slides lecture 01
Object oriented programming (oop)   cs304 power point slides lecture 01Object oriented programming (oop)   cs304 power point slides lecture 01
Object oriented programming (oop) cs304 power point slides lecture 01Adil Kakakhel
 
Introduction to Object Oriented Programming
Introduction to Object Oriented ProgrammingIntroduction to Object Oriented Programming
Introduction to Object Oriented ProgrammingMoutaz Haddara
 
Object-Oriented Programming Concepts
Object-Oriented Programming ConceptsObject-Oriented Programming Concepts
Object-Oriented Programming ConceptsKwangshin Oh
 
C++ classes tutorials
C++ classes tutorialsC++ classes tutorials
C++ classes tutorialsMayank Jain
 
Stream classes in C++
Stream classes in C++Stream classes in C++
Stream classes in C++Shyam Gupta
 
Inheritance in c++ ppt (Powerpoint) | inheritance in c++ ppt presentation | i...
Inheritance in c++ ppt (Powerpoint) | inheritance in c++ ppt presentation | i...Inheritance in c++ ppt (Powerpoint) | inheritance in c++ ppt presentation | i...
Inheritance in c++ ppt (Powerpoint) | inheritance in c++ ppt presentation | i...cprogrammings
 

Viewers also liked (20)

class and objects
class and objectsclass and objects
class and objects
 
C++ classes tutorials
C++ classes tutorialsC++ classes tutorials
C++ classes tutorials
 
Oops ppt
Oops pptOops ppt
Oops ppt
 
Basic concepts of object oriented programming
Basic concepts of object oriented programmingBasic concepts of object oriented programming
Basic concepts of object oriented programming
 
Classes And Objects
Classes And ObjectsClasses And Objects
Classes And Objects
 
Object Oriented Programming Concepts
Object Oriented Programming ConceptsObject Oriented Programming Concepts
Object Oriented Programming Concepts
 
Object oriented programming (oop) cs304 power point slides lecture 01
Object oriented programming (oop)   cs304 power point slides lecture 01Object oriented programming (oop)   cs304 power point slides lecture 01
Object oriented programming (oop) cs304 power point slides lecture 01
 
Introduction to Object Oriented Programming
Introduction to Object Oriented ProgrammingIntroduction to Object Oriented Programming
Introduction to Object Oriented Programming
 
Object-oriented concepts
Object-oriented conceptsObject-oriented concepts
Object-oriented concepts
 
C++ classes
C++ classesC++ classes
C++ classes
 
Object-Oriented Programming Concepts
Object-Oriented Programming ConceptsObject-Oriented Programming Concepts
Object-Oriented Programming Concepts
 
C++ Pointers
C++ PointersC++ Pointers
C++ Pointers
 
Object and class
Object and classObject and class
Object and class
 
C++ classes tutorials
C++ classes tutorialsC++ classes tutorials
C++ classes tutorials
 
OOP
OOPOOP
OOP
 
Stream classes in C++
Stream classes in C++Stream classes in C++
Stream classes in C++
 
C++ language
C++ languageC++ language
C++ language
 
Inheritance in c++ ppt (Powerpoint) | inheritance in c++ ppt presentation | i...
Inheritance in c++ ppt (Powerpoint) | inheritance in c++ ppt presentation | i...Inheritance in c++ ppt (Powerpoint) | inheritance in c++ ppt presentation | i...
Inheritance in c++ ppt (Powerpoint) | inheritance in c++ ppt presentation | i...
 
Constructors & destructors
Constructors & destructorsConstructors & destructors
Constructors & destructors
 
Inheritance
InheritanceInheritance
Inheritance
 

Similar to C++ classes

oop lecture 3
oop lecture 3oop lecture 3
oop lecture 3Atif Khan
 
OBJECT ORIENTED PROGRAMING IN C++
OBJECT ORIENTED PROGRAMING IN C++ OBJECT ORIENTED PROGRAMING IN C++
OBJECT ORIENTED PROGRAMING IN C++ Dev Chauhan
 
chapter-7-classes-and-objects.pdf
chapter-7-classes-and-objects.pdfchapter-7-classes-and-objects.pdf
chapter-7-classes-and-objects.pdfstudy material
 
Introduction to object oriented programming concepts
Introduction to object oriented programming conceptsIntroduction to object oriented programming concepts
Introduction to object oriented programming conceptsGanesh Karthik
 
object oriented programming using java, second sem BCA,UoM
object oriented programming using java, second sem BCA,UoMobject oriented programming using java, second sem BCA,UoM
object oriented programming using java, second sem BCA,UoMambikavenkatesh2
 
Classes, objects and methods
Classes, objects and methodsClasses, objects and methods
Classes, objects and methodsfarhan amjad
 
Object and class presentation
Object and class presentationObject and class presentation
Object and class presentationnafisa rahman
 
C++ largest no between three nos
C++ largest no between three nosC++ largest no between three nos
C++ largest no between three noskrismishra
 
Computer programming(C++): Structures
Computer programming(C++): StructuresComputer programming(C++): Structures
Computer programming(C++): StructuresJishnuNath7
 

Similar to C++ classes (20)

Class and object
Class and objectClass and object
Class and object
 
Lecture 2 (1)
Lecture 2 (1)Lecture 2 (1)
Lecture 2 (1)
 
oop lecture 3
oop lecture 3oop lecture 3
oop lecture 3
 
C++ Notes
C++ NotesC++ Notes
C++ Notes
 
OBJECT ORIENTED PROGRAMING IN C++
OBJECT ORIENTED PROGRAMING IN C++ OBJECT ORIENTED PROGRAMING IN C++
OBJECT ORIENTED PROGRAMING IN C++
 
Lecture 4. mte 407
Lecture 4. mte 407Lecture 4. mte 407
Lecture 4. mte 407
 
My c++
My c++My c++
My c++
 
Opp concept in c++
Opp concept in c++Opp concept in c++
Opp concept in c++
 
chapter-7-classes-and-objects.pdf
chapter-7-classes-and-objects.pdfchapter-7-classes-and-objects.pdf
chapter-7-classes-and-objects.pdf
 
Introduction to object oriented programming concepts
Introduction to object oriented programming conceptsIntroduction to object oriented programming concepts
Introduction to object oriented programming concepts
 
object oriented programming using java, second sem BCA,UoM
object oriented programming using java, second sem BCA,UoMobject oriented programming using java, second sem BCA,UoM
object oriented programming using java, second sem BCA,UoM
 
Classes, objects and methods
Classes, objects and methodsClasses, objects and methods
Classes, objects and methods
 
OOPs & C++ UNIT 3
OOPs & C++ UNIT 3OOPs & C++ UNIT 3
OOPs & C++ UNIT 3
 
Object and class presentation
Object and class presentationObject and class presentation
Object and class presentation
 
C++ largest no between three nos
C++ largest no between three nosC++ largest no between three nos
C++ largest no between three nos
 
class c++
class c++class c++
class c++
 
Php oop (1)
Php oop (1)Php oop (1)
Php oop (1)
 
oopm 2.pdf
oopm 2.pdfoopm 2.pdf
oopm 2.pdf
 
Lecture 9
Lecture 9Lecture 9
Lecture 9
 
Computer programming(C++): Structures
Computer programming(C++): StructuresComputer programming(C++): Structures
Computer programming(C++): Structures
 

C++ classes