SlideShare a Scribd company logo
OOPs with C++ Lecture 4
What is Object Oriented Programming? ,[object Object],[object Object],[object Object],[object Object],[object Object]
The two steps of Object Oriented Programming ,[object Object],[object Object]
Example: The Creature class ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Example: The Creature 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],Note that unless the methods are very short, declaration and implementation is usually separated. The declaration goes into a header file (.h), the implementation in a .cpp file.
Classes & Objects ,[object Object],[object Object],So a class is a blueprint for objects
Objects & Classes ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Instantiating Objects ,[object Object],[object Object],[object Object],[object Object],Declaring z of type ‘creature’  means we have generated an object with the attributes and methods of the class.
Multiple Objects ,[object Object],[object Object],[object Object],[object Object],Creates three objects.
Sending Messages /    Calling Methods. ,[object Object],[object Object],[object Object],[object Object],Messages are sent to my dog and the milkman.
Back to the Instantiation... ,[object Object],[object Object],[object Object],[object Object],Here the “default constructor” of the Creature class is automatically called. If we don’t like this we can specify constructors explicitly!
End

More Related Content

What's hot

Oops concept in c++ unit 3 -topic 4
Oops concept in c++ unit 3 -topic 4Oops concept in c++ unit 3 -topic 4
Oops concept in c++ unit 3 -topic 4
MOHIT TOMAR
 
Oo ps concepts in c++
Oo ps concepts in c++Oo ps concepts in c++
Oo ps concepts in c++
Hemant Saini
 
Oops And C++ Fundamentals
Oops And C++ FundamentalsOops And C++ Fundamentals
Oops And C++ Fundamentals
Subhasis Nayak
 
concept of oops
concept of oopsconcept of oops
concept of oops
prince sharma
 
Object Oriented Programming Concepts
Object Oriented Programming ConceptsObject Oriented Programming Concepts
Object Oriented Programming Conceptsthinkphp
 
Std 12 computer chapter 6 object oriented concepts (part 1)
Std 12 computer chapter 6 object oriented concepts (part 1)Std 12 computer chapter 6 object oriented concepts (part 1)
Std 12 computer chapter 6 object oriented concepts (part 1)
Nuzhat Memon
 
Object oriented concepts
Object oriented conceptsObject oriented concepts
Object oriented concepts
Pranali Chaudhari
 
Object Oriented Language
Object Oriented LanguageObject Oriented Language
Object Oriented Languagedheva B
 
Object Oriented Concepts in Real Projects
Object Oriented Concepts in Real ProjectsObject Oriented Concepts in Real Projects
Object Oriented Concepts in Real Projects
EPAM
 
Introduction to Object Oriented Programming
Introduction to Object Oriented ProgrammingIntroduction to Object Oriented Programming
Introduction to Object Oriented Programming
Md. Tanvir Hossain
 
Object Oriented Programming Concepts using Java
Object Oriented Programming Concepts using JavaObject Oriented Programming Concepts using Java
Object Oriented Programming Concepts using Java
Glenn Guden
 
Object oriented programming concept
Object oriented programming conceptObject oriented programming concept
Object oriented programming concept
Pina Parmar
 
Object Oriented Technologies
Object Oriented TechnologiesObject Oriented Technologies
Object Oriented Technologies
Tushar B Kute
 
Oop concepts classes_objects
Oop concepts classes_objectsOop concepts classes_objects
Oop concepts classes_objects
William Olivier
 
Oop ppt
Oop pptOop ppt
Oop ppt
Shani Manjara
 
object oriented programing lecture 1
object oriented programing lecture 1object oriented programing lecture 1
object oriented programing lecture 1
Geophery sanga
 
Object Oriented Concepts and Principles
Object Oriented Concepts and PrinciplesObject Oriented Concepts and Principles
Object Oriented Concepts and Principles
deonpmeyer
 

What's hot (20)

Oops concept in c++ unit 3 -topic 4
Oops concept in c++ unit 3 -topic 4Oops concept in c++ unit 3 -topic 4
Oops concept in c++ unit 3 -topic 4
 
C plusplus
C plusplusC plusplus
C plusplus
 
Oo ps concepts in c++
Oo ps concepts in c++Oo ps concepts in c++
Oo ps concepts in c++
 
Oops And C++ Fundamentals
Oops And C++ FundamentalsOops And C++ Fundamentals
Oops And C++ Fundamentals
 
concept of oops
concept of oopsconcept of oops
concept of oops
 
Object Oriented Programming Concepts
Object Oriented Programming ConceptsObject Oriented Programming Concepts
Object Oriented Programming Concepts
 
General OOP concept [by-Digvijay]
General OOP concept [by-Digvijay]General OOP concept [by-Digvijay]
General OOP concept [by-Digvijay]
 
Std 12 computer chapter 6 object oriented concepts (part 1)
Std 12 computer chapter 6 object oriented concepts (part 1)Std 12 computer chapter 6 object oriented concepts (part 1)
Std 12 computer chapter 6 object oriented concepts (part 1)
 
Object oriented concepts
Object oriented conceptsObject oriented concepts
Object oriented concepts
 
Object Oriented Language
Object Oriented LanguageObject Oriented Language
Object Oriented Language
 
Object Oriented Concepts in Real Projects
Object Oriented Concepts in Real ProjectsObject Oriented Concepts in Real Projects
Object Oriented Concepts in Real Projects
 
Introduction to Object Oriented Programming
Introduction to Object Oriented ProgrammingIntroduction to Object Oriented Programming
Introduction to Object Oriented Programming
 
Characteristics of oop
Characteristics of oopCharacteristics of oop
Characteristics of oop
 
Object Oriented Programming Concepts using Java
Object Oriented Programming Concepts using JavaObject Oriented Programming Concepts using Java
Object Oriented Programming Concepts using Java
 
Object oriented programming concept
Object oriented programming conceptObject oriented programming concept
Object oriented programming concept
 
Object Oriented Technologies
Object Oriented TechnologiesObject Oriented Technologies
Object Oriented Technologies
 
Oop concepts classes_objects
Oop concepts classes_objectsOop concepts classes_objects
Oop concepts classes_objects
 
Oop ppt
Oop pptOop ppt
Oop ppt
 
object oriented programing lecture 1
object oriented programing lecture 1object oriented programing lecture 1
object oriented programing lecture 1
 
Object Oriented Concepts and Principles
Object Oriented Concepts and PrinciplesObject Oriented Concepts and Principles
Object Oriented Concepts and Principles
 

Viewers also liked

Assignment#4 gorosito
Assignment#4 gorositoAssignment#4 gorosito
Assignment#4 gorosito
AnnyaM
 
I love you
I love youI love you
I love you
lurgifaliya roosen
 
BCI Softline Library Seating Catalog (2011)
BCI Softline Library Seating Catalog (2011)BCI Softline Library Seating Catalog (2011)
BCI Softline Library Seating Catalog (2011)
BCIEurobib
 
Autobiografia cleo
Autobiografia cleoAutobiografia cleo
Autobiografia cleotony
 
Formas basicas con sombra (1)
Formas basicas con sombra (1)Formas basicas con sombra (1)
Formas basicas con sombra (1)camilo
 
Schools direct pres_updated[1]
Schools direct pres_updated[1]Schools direct pres_updated[1]
Schools direct pres_updated[1]
skumbuzo
 
Empirical investment group
Empirical investment groupEmpirical investment group
Empirical investment group
Chhitiz Shrestha
 
Thankful Memes
Thankful MemesThankful Memes
Thankful Memes
JCC of Staten Island
 
El pueblo quezon city
El pueblo quezon cityEl pueblo quezon city
El pueblo quezon city
dryxjorta
 
เสาวลักษณ์
เสาวลักษณ์เสาวลักษณ์
เสาวลักษณ์earnearn31
 
Pest(tech)
Pest(tech)Pest(tech)
Pest(tech)shibom
 
Thankful Memes Updated
Thankful Memes UpdatedThankful Memes Updated
Thankful Memes Updated
JCC of Staten Island
 
Essay final exam - marina gorosito
Essay   final exam - marina gorositoEssay   final exam - marina gorosito
Essay final exam - marina gorositoAnnyaM
 

Viewers also liked (20)

Assignment#4 gorosito
Assignment#4 gorositoAssignment#4 gorosito
Assignment#4 gorosito
 
I love you
I love youI love you
I love you
 
Hepatitis a
Hepatitis aHepatitis a
Hepatitis a
 
Sensatez...
Sensatez...Sensatez...
Sensatez...
 
O jornal...
O jornal...O jornal...
O jornal...
 
BCI Softline Library Seating Catalog (2011)
BCI Softline Library Seating Catalog (2011)BCI Softline Library Seating Catalog (2011)
BCI Softline Library Seating Catalog (2011)
 
Autobiografia cleo
Autobiografia cleoAutobiografia cleo
Autobiografia cleo
 
Euthenics How to dress on a date Powerpoint
Euthenics How to dress on a date PowerpointEuthenics How to dress on a date Powerpoint
Euthenics How to dress on a date Powerpoint
 
Formas basicas con sombra (1)
Formas basicas con sombra (1)Formas basicas con sombra (1)
Formas basicas con sombra (1)
 
Acnrjf10 biochemical
Acnrjf10 biochemicalAcnrjf10 biochemical
Acnrjf10 biochemical
 
Membership Crossroads
Membership CrossroadsMembership Crossroads
Membership Crossroads
 
Schools direct pres_updated[1]
Schools direct pres_updated[1]Schools direct pres_updated[1]
Schools direct pres_updated[1]
 
Empirical investment group
Empirical investment groupEmpirical investment group
Empirical investment group
 
Thankful Memes
Thankful MemesThankful Memes
Thankful Memes
 
El pueblo quezon city
El pueblo quezon cityEl pueblo quezon city
El pueblo quezon city
 
เสาวลักษณ์
เสาวลักษณ์เสาวลักษณ์
เสาวลักษณ์
 
Pest(tech)
Pest(tech)Pest(tech)
Pest(tech)
 
Thankful Memes Updated
Thankful Memes UpdatedThankful Memes Updated
Thankful Memes Updated
 
Essay final exam - marina gorosito
Essay   final exam - marina gorositoEssay   final exam - marina gorosito
Essay final exam - marina gorosito
 
Euro shop 2014 trend recap
Euro shop 2014 trend recapEuro shop 2014 trend recap
Euro shop 2014 trend recap
 

Similar to Lecture 4

香港六合彩 » SlideShare
香港六合彩 » SlideShare香港六合彩 » SlideShare
香港六合彩 » SlideShare
biyu
 
Basic concept of oops
Basic concept of oopsBasic concept of oops
Basic concept of oops
Padma Kannan
 
Chapter2 array of objects
Chapter2 array of objectsChapter2 array of objects
Chapter2 array of objects
Mahmoud Alfarra
 
Advanced CPP Lecture 1- Summer School 2014 - ACA CSE IITK
Advanced CPP Lecture 1- Summer School 2014 - ACA CSE IITKAdvanced CPP Lecture 1- Summer School 2014 - ACA CSE IITK
Advanced CPP Lecture 1- Summer School 2014 - ACA CSE IITKPankaj Prateek
 
C++ largest no between three nos
C++ largest no between three nosC++ largest no between three nos
C++ largest no between three nos
krismishra
 
Basic OOPs Concepts (E-next.in).pdf
Basic OOPs Concepts (E-next.in).pdfBasic OOPs Concepts (E-next.in).pdf
Basic OOPs Concepts (E-next.in).pdf
ShubhamMadaan9
 
Objects by Sufian Idris
Objects by Sufian IdrisObjects by Sufian Idris
Objects by Sufian Idris
Universiti Kebangsaan Malaysia
 
Python Programming - Object-Oriented
Python Programming - Object-OrientedPython Programming - Object-Oriented
Python Programming - Object-Oriented
Omid AmirGhiasvand
 
Assignment #4 will be the construction of 2 new classes and a driver program/...
Assignment #4 will be the construction of 2 new classes and a driver program/...Assignment #4 will be the construction of 2 new classes and a driver program/...
Assignment #4 will be the construction of 2 new classes and a driver program/...
hwbloom3
 
how to create object
how to create objecthow to create object
how to create object
Subhasis Nayak
 
Ch2
Ch2Ch2
Classes-and-Object.pptx
Classes-and-Object.pptxClasses-and-Object.pptx
Classes-and-Object.pptx
VishwanathanS5
 
Object Oriented Programming using C++(UNIT 1)
Object Oriented Programming using C++(UNIT 1)Object Oriented Programming using C++(UNIT 1)
Object Oriented Programming using C++(UNIT 1)
SURBHI SAROHA
 
Object Oriented PHP - PART-1
Object Oriented PHP - PART-1Object Oriented PHP - PART-1
Object Oriented PHP - PART-1
Jalpesh Vasa
 
Ios development
Ios developmentIos development
Ios development
elnaqah
 
Object oriented javascript
Object oriented javascriptObject oriented javascript
Object oriented javascript
Shah Jalal
 
packages and interfaces
packages and interfacespackages and interfaces
packages and interfaces
madhavi patil
 

Similar to Lecture 4 (20)

香港六合彩 » SlideShare
香港六合彩 » SlideShare香港六合彩 » SlideShare
香港六合彩 » SlideShare
 
Basic concept of oops
Basic concept of oopsBasic concept of oops
Basic concept of oops
 
Chapter2 array of objects
Chapter2 array of objectsChapter2 array of objects
Chapter2 array of objects
 
Advanced CPP Lecture 1- Summer School 2014 - ACA CSE IITK
Advanced CPP Lecture 1- Summer School 2014 - ACA CSE IITKAdvanced CPP Lecture 1- Summer School 2014 - ACA CSE IITK
Advanced CPP Lecture 1- Summer School 2014 - ACA CSE IITK
 
C++ largest no between three nos
C++ largest no between three nosC++ largest no between three nos
C++ largest no between three nos
 
Basic OOPs Concepts (E-next.in).pdf
Basic OOPs Concepts (E-next.in).pdfBasic OOPs Concepts (E-next.in).pdf
Basic OOPs Concepts (E-next.in).pdf
 
Objects by Sufian Idris
Objects by Sufian IdrisObjects by Sufian Idris
Objects by Sufian Idris
 
Python Programming - Object-Oriented
Python Programming - Object-OrientedPython Programming - Object-Oriented
Python Programming - Object-Oriented
 
Week1
Week1Week1
Week1
 
Assignment #4 will be the construction of 2 new classes and a driver program/...
Assignment #4 will be the construction of 2 new classes and a driver program/...Assignment #4 will be the construction of 2 new classes and a driver program/...
Assignment #4 will be the construction of 2 new classes and a driver program/...
 
how to create object
how to create objecthow to create object
how to create object
 
Ch2
Ch2Ch2
Ch2
 
Classes-and-Object.pptx
Classes-and-Object.pptxClasses-and-Object.pptx
Classes-and-Object.pptx
 
P1
P1P1
P1
 
Object Oriented Programming using C++(UNIT 1)
Object Oriented Programming using C++(UNIT 1)Object Oriented Programming using C++(UNIT 1)
Object Oriented Programming using C++(UNIT 1)
 
Object Oriented PHP - PART-1
Object Oriented PHP - PART-1Object Oriented PHP - PART-1
Object Oriented PHP - PART-1
 
Ios development
Ios developmentIos development
Ios development
 
OOPS
OOPSOOPS
OOPS
 
Object oriented javascript
Object oriented javascriptObject oriented javascript
Object oriented javascript
 
packages and interfaces
packages and interfacespackages and interfaces
packages and interfaces
 

More from emailharmeet

Lecture 10 distributed database management system
Lecture 10   distributed database management systemLecture 10   distributed database management system
Lecture 10 distributed database management systememailharmeet
 
Lecture 09 dblc centralized vs decentralized design
Lecture 09   dblc centralized vs decentralized designLecture 09   dblc centralized vs decentralized design
Lecture 09 dblc centralized vs decentralized designemailharmeet
 
Lecture 09 dblc centralized vs decentralized design
Lecture 09   dblc centralized vs decentralized designLecture 09   dblc centralized vs decentralized design
Lecture 09 dblc centralized vs decentralized designemailharmeet
 
Lecture 08 distributed dbms
Lecture 08 distributed dbmsLecture 08 distributed dbms
Lecture 08 distributed dbmsemailharmeet
 
Lecture 07 relational database management system
Lecture 07 relational database management systemLecture 07 relational database management system
Lecture 07 relational database management systememailharmeet
 
Lecture 06 relational algebra and calculus
Lecture 06 relational algebra and calculusLecture 06 relational algebra and calculus
Lecture 06 relational algebra and calculusemailharmeet
 
Testing lecture after lec 4
Testing lecture after lec 4Testing lecture after lec 4
Testing lecture after lec 4emailharmeet
 
Course File c++
Course File c++Course File c++
Course File c++
emailharmeet
 
Lecture 05 dblc
Lecture 05 dblcLecture 05 dblc
Lecture 05 dblc
emailharmeet
 
Assignmnet 1
Assignmnet 1Assignmnet 1
Assignmnet 1
emailharmeet
 
Lecture 04 normalization
Lecture 04 normalization Lecture 04 normalization
Lecture 04 normalization emailharmeet
 
Lecture 03 data abstraction and er model
Lecture 03 data abstraction and er modelLecture 03 data abstraction and er model
Lecture 03 data abstraction and er modelemailharmeet
 
Lecture 02 terminology of database
Lecture 02 terminology of  databaseLecture 02 terminology of  database
Lecture 02 terminology of databaseemailharmeet
 
Lecture 01 introduction to database
Lecture 01 introduction to databaseLecture 01 introduction to database
Lecture 01 introduction to databaseemailharmeet
 
Lecture 00 introduction to course
Lecture 00 introduction to courseLecture 00 introduction to course
Lecture 00 introduction to course
emailharmeet
 
Syllabus mca 2 rdbms i
Syllabus mca 2 rdbms iSyllabus mca 2 rdbms i
Syllabus mca 2 rdbms iemailharmeet
 

More from emailharmeet (19)

Lecture 10 distributed database management system
Lecture 10   distributed database management systemLecture 10   distributed database management system
Lecture 10 distributed database management system
 
Lecture 09 dblc centralized vs decentralized design
Lecture 09   dblc centralized vs decentralized designLecture 09   dblc centralized vs decentralized design
Lecture 09 dblc centralized vs decentralized design
 
Lecture 09 dblc centralized vs decentralized design
Lecture 09   dblc centralized vs decentralized designLecture 09   dblc centralized vs decentralized design
Lecture 09 dblc centralized vs decentralized design
 
Lecture 08 distributed dbms
Lecture 08 distributed dbmsLecture 08 distributed dbms
Lecture 08 distributed dbms
 
Lecture 07 relational database management system
Lecture 07 relational database management systemLecture 07 relational database management system
Lecture 07 relational database management system
 
Lecture 06 relational algebra and calculus
Lecture 06 relational algebra and calculusLecture 06 relational algebra and calculus
Lecture 06 relational algebra and calculus
 
Testing lecture after lec 4
Testing lecture after lec 4Testing lecture after lec 4
Testing lecture after lec 4
 
Lab 1
Lab 1Lab 1
Lab 1
 
Revision Lecture
Revision LectureRevision Lecture
Revision Lecture
 
Lecture 3 c++
Lecture 3 c++Lecture 3 c++
Lecture 3 c++
 
Course File c++
Course File c++Course File c++
Course File c++
 
Lecture 05 dblc
Lecture 05 dblcLecture 05 dblc
Lecture 05 dblc
 
Assignmnet 1
Assignmnet 1Assignmnet 1
Assignmnet 1
 
Lecture 04 normalization
Lecture 04 normalization Lecture 04 normalization
Lecture 04 normalization
 
Lecture 03 data abstraction and er model
Lecture 03 data abstraction and er modelLecture 03 data abstraction and er model
Lecture 03 data abstraction and er model
 
Lecture 02 terminology of database
Lecture 02 terminology of  databaseLecture 02 terminology of  database
Lecture 02 terminology of database
 
Lecture 01 introduction to database
Lecture 01 introduction to databaseLecture 01 introduction to database
Lecture 01 introduction to database
 
Lecture 00 introduction to course
Lecture 00 introduction to courseLecture 00 introduction to course
Lecture 00 introduction to course
 
Syllabus mca 2 rdbms i
Syllabus mca 2 rdbms iSyllabus mca 2 rdbms i
Syllabus mca 2 rdbms i
 

Lecture 4