SlideShare uma empresa Scribd logo
1 de 12
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

Mais conteúdo relacionado

Mais procurados

Object Oriented Programming Concepts
Object Oriented Programming ConceptsObject Oriented Programming Concepts
Object Oriented Programming Concepts
thinkphp
 
Object Oriented Language
Object Oriented LanguageObject Oriented Language
Object Oriented Language
dheva B
 

Mais procurados (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
 

Destaque

Autobiografia cleo
Autobiografia cleoAutobiografia cleo
Autobiografia cleo
tony
 
Formas basicas con sombra (1)
Formas basicas con sombra (1)Formas basicas con sombra (1)
Formas basicas con sombra (1)
camilo
 
เสาวลักษณ์
เสาวลักษณ์เสาวลักษณ์
เสาวลักษณ์
earnearn31
 
Pest(tech)
Pest(tech)Pest(tech)
Pest(tech)
shibom
 
Essay final exam - marina gorosito
Essay   final exam - marina gorositoEssay   final exam - marina gorosito
Essay final exam - marina gorosito
AnnyaM
 

Destaque (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
 

Semelhante a Lecture 4

香港六合彩 » SlideShare
香港六合彩 » SlideShare香港六合彩 » SlideShare
香港六合彩 » SlideShare
biyu
 
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
Pankaj 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
 
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
 
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
 

Semelhante a 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
 

Mais de emailharmeet

Lecture 10 distributed database management system
Lecture 10   distributed database management systemLecture 10   distributed database management system
Lecture 10 distributed database management system
emailharmeet
 
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
emailharmeet
 
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
emailharmeet
 
Lecture 08 distributed dbms
Lecture 08 distributed dbmsLecture 08 distributed dbms
Lecture 08 distributed dbms
emailharmeet
 
Lecture 07 relational database management system
Lecture 07 relational database management systemLecture 07 relational database management system
Lecture 07 relational database management system
emailharmeet
 
Lecture 06 relational algebra and calculus
Lecture 06 relational algebra and calculusLecture 06 relational algebra and calculus
Lecture 06 relational algebra and calculus
emailharmeet
 
Testing lecture after lec 4
Testing lecture after lec 4Testing lecture after lec 4
Testing lecture after lec 4
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 model
emailharmeet
 
Lecture 02 terminology of database
Lecture 02 terminology of  databaseLecture 02 terminology of  database
Lecture 02 terminology of database
emailharmeet
 
Lecture 01 introduction to database
Lecture 01 introduction to databaseLecture 01 introduction to database
Lecture 01 introduction to database
emailharmeet
 
Syllabus mca 2 rdbms i
Syllabus mca 2 rdbms iSyllabus mca 2 rdbms i
Syllabus mca 2 rdbms i
emailharmeet
 

Mais de 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