SlideShare ist ein Scribd-Unternehmen logo
1 von 23
Downloaden Sie, um offline zu lesen
OOPOOPObject Oriented ProgrammingObject Oriented Programming
By : Tauseef Ahmad (107)
Evolution of OOPEvolution of OOP
1,0
Machine Language
Assembly Language
Procedure-Oriented
Object-Oriented Programming
Procedure-OrientedProcedure-Oriented
• The primary focus is on functions.
• It basically consist of list of instructions for computer
to follow, and to organize these instructions into
groups known as functions.
Structure of POPStructure of POP
[Procedure oriented programming][Procedure oriented programming]
Main Program
Function-1 Function-2 Function-3
Function-4 Function-5
Function-6 Function-7 Function-8
Drawbacks of POPDrawbacks of POP
• Most of the function share global data.
• It does not model real world problem very well.
Global data Global data
Function-1 Function-1 Function-1
Local Data Local Data Local Data
Object-Oriented LanguagesObject-Oriented Languages
• Object-oriented programming is not the right of any
particular language.
• Like structured programming, OOP concept can be
implemented using any language like C and
Pascal.
Object-Oriented ParadigmObject-Oriented Paradigm
• Object-oriented programming (OOP) is a
programming paradigm that uses "Objects" and
their interactions to design applications and
computer programs.
• Everything around us are objects interacting with
each others.
• Each object has a set of features, including
adjectives and verbs.
• Object-oriented paradigms is sometimes thought to
be a simulation of the real-world around us, which
make it the paradigm of choice for most
application domains: GUIs, games, business, etc.
Basic concepts of OOPBasic concepts of OOP
• Objects
• Classes
• Data Abstraction and Encapsulation
• Inheritance
• Polymorphism
• Dynamic Binding
• Message Passing
ObjectsObjects
• Objects are the run-time entities.
• It may represent a person, a place, a bank
account, a table of data or any item.
• Objects take up space in the memory and have an
associated address like a structure in c.
• Some examples : car, man, woman etc
ClassesClasses
• A class is an abstract definition of an object.
• Defines how would the object look like when
created.
• Think of classes like the patents of actual inventions.
EncapsulationEncapsulation
• Wrapping up of data and functions into a single unit
is known as Encapsulation.
• Encapsulation is hiding the functional details from
the object calling it.
• Can you drive a car?
o Yes, I can!
• So, how does acceleration work?
o Huh?
• Details encapsulated (hidden) from the driver.
Data AbstractionData Abstraction
• Abstraction refers to the act of representing
essential features without including the background
details or explanation.
• An abstraction is a form of representation that
includes only what is useful or interesting from a
particular viewpoint.
• Example : A map is an abstract representation,
since no map shows every detail of the territory it
covers
InheritanceInheritance
• Inheritance is the process by which objects of one
class acquire the properties of objects of another
class.
name
phoneNumber
address
hourlyWage
WageContract()
CalculateTax()
PayTuition()
DropCourse()
Professor
name
phoneNumber
address
salary
TeachCourse()
CalculateTax()
DevelopCourse()
OR
Employee
name
phoneNumber
address
CalculateTax()
SupportStaff Professor
TeachCourse()
DevelopCourse()
salary
Subclasses
WageContract()
hourlyWage
SupportStaff
InheritanceInheritance
Man
Suzuki
Woman
BMW
Car Human
PolymorphismPolymorphism
int add(int a, int b, int c)
{
return (a+b+c); It will return addition
} of 3 integer numbers
int add(int a,int b)
{
return (a+b); It will return addition
} of 2 integer numbers
float add(float a, float b, float c)
{
return (a+b+c); It will return addition
} of 3 float numbers
PolymorphismPolymorphism
• Polymorphism is a Greek term means the ability to
take more than one form.
Shape
Draw()
Circle Object
Draw (circle)
Box Object
Draw (box)
Triangle Object
Draw (triangle)
Message PassingMessage Passing
• The process by which an object:
o Sends data to another object.
o Asks the other object to invoke a method.
• In other words, objects talk to each others via
messages.
18
Object and Their InteractionObject and Their Interaction
Program
19
Object and Their InteractionObject and Their Interaction
Program
Tom, hold your sweep!
20
Object and Their InteractionObject and Their Interaction
Program
Tom, hold your sweep!
Tom, beat jerry!
21
Object and Their InteractionObject and Their Interaction
Program
Tom.holdYourSweep()
Tom.BeatJerry()
IN PROGRAMMING
22
Object and Their InteractionObject and Their Interaction
Program
Tom.holdYourSweep()
Tom.BeatJerry()
IN PROGRAMMING
message
23
Object and Their InteractionObject and Their Interaction
Program
Tom.holdYourSweep()
Tom.BeatJerry()
IN PROGRAMMING
message
message

Weitere ähnliche Inhalte

Andere mochten auch

Object Oriented Programming Concepts
Object Oriented Programming ConceptsObject Oriented Programming Concepts
Object Oriented Programming ConceptsBhushan Nagaraj
 
Object Oriented Concepts in Real Projects
Object Oriented Concepts in Real ProjectsObject Oriented Concepts in Real Projects
Object Oriented Concepts in Real ProjectsEPAM
 
Object Oriented Design And Programing
Object Oriented Design And ProgramingObject Oriented Design And Programing
Object Oriented Design And ProgramingEmmanuel Fuchs
 
Object Oriented Programming Concepts
Object Oriented Programming ConceptsObject Oriented Programming Concepts
Object Oriented Programming ConceptsAbhigyan Singh Yadav
 
An Introduction to Object-Oriented Programming (DrupalCamp North 2015)
An Introduction to Object-Oriented Programming (DrupalCamp North 2015)An Introduction to Object-Oriented Programming (DrupalCamp North 2015)
An Introduction to Object-Oriented Programming (DrupalCamp North 2015)Bart Feenstra
 
Object Oriented Paradigm
Object Oriented ParadigmObject Oriented Paradigm
Object Oriented ParadigmHüseyin Ergin
 
Object-Oriented Design Heuristics
Object-Oriented Design HeuristicsObject-Oriented Design Heuristics
Object-Oriented Design Heuristicskim.mens
 
Object Oriented Programming Concepts using Java
Object Oriented Programming Concepts using JavaObject Oriented Programming Concepts using Java
Object Oriented Programming Concepts using JavaGlenn Guden
 
Concepts In Object Oriented Programming Languages
Concepts In Object Oriented Programming LanguagesConcepts In Object Oriented Programming Languages
Concepts In Object Oriented Programming Languagesppd1961
 
Basic concepts of object oriented programming
Basic concepts of object oriented programmingBasic concepts of object oriented programming
Basic concepts of object oriented programmingSachin Sharma
 
Oop concepts classes_objects
Oop concepts classes_objectsOop concepts classes_objects
Oop concepts classes_objectsWilliam Olivier
 
Object Oriented Programming Concepts
Object Oriented Programming ConceptsObject Oriented Programming Concepts
Object Oriented Programming Conceptsthinkphp
 
20. Object-Oriented Programming Fundamental Principles
20. Object-Oriented Programming Fundamental Principles20. Object-Oriented Programming Fundamental Principles
20. Object-Oriented Programming Fundamental PrinciplesIntro C# Book
 

Andere mochten auch (17)

1-oop java-object
1-oop java-object1-oop java-object
1-oop java-object
 
10- java language basics part4
10- java language basics part410- java language basics part4
10- java language basics part4
 
Object Oriented Programming Concepts
Object Oriented Programming ConceptsObject Oriented Programming Concepts
Object Oriented Programming Concepts
 
Object Oriented Concepts in Real Projects
Object Oriented Concepts in Real ProjectsObject Oriented Concepts in Real Projects
Object Oriented Concepts in Real Projects
 
Object Oriented Design And Programing
Object Oriented Design And ProgramingObject Oriented Design And Programing
Object Oriented Design And Programing
 
Object Oriented Programming Concepts
Object Oriented Programming ConceptsObject Oriented Programming Concepts
Object Oriented Programming Concepts
 
An Introduction to Object-Oriented Programming (DrupalCamp North 2015)
An Introduction to Object-Oriented Programming (DrupalCamp North 2015)An Introduction to Object-Oriented Programming (DrupalCamp North 2015)
An Introduction to Object-Oriented Programming (DrupalCamp North 2015)
 
Oops concepts
Oops conceptsOops concepts
Oops concepts
 
Object Oriented Paradigm
Object Oriented ParadigmObject Oriented Paradigm
Object Oriented Paradigm
 
Object-Oriented Design Heuristics
Object-Oriented Design HeuristicsObject-Oriented Design Heuristics
Object-Oriented Design Heuristics
 
Object Oriented Programming Concepts using Java
Object Oriented Programming Concepts using JavaObject Oriented Programming Concepts using Java
Object Oriented Programming Concepts using Java
 
Concepts In Object Oriented Programming Languages
Concepts In Object Oriented Programming LanguagesConcepts In Object Oriented Programming Languages
Concepts In Object Oriented Programming Languages
 
Object Oriented Design
Object Oriented DesignObject Oriented Design
Object Oriented Design
 
Basic concepts of object oriented programming
Basic concepts of object oriented programmingBasic concepts of object oriented programming
Basic concepts of object oriented programming
 
Oop concepts classes_objects
Oop concepts classes_objectsOop concepts classes_objects
Oop concepts classes_objects
 
Object Oriented Programming Concepts
Object Oriented Programming ConceptsObject Oriented Programming Concepts
Object Oriented Programming Concepts
 
20. Object-Oriented Programming Fundamental Principles
20. Object-Oriented Programming Fundamental Principles20. Object-Oriented Programming Fundamental Principles
20. Object-Oriented Programming Fundamental Principles
 

Ähnlich wie Oop’s

introduction of Object oriented programming
introduction of Object oriented programmingintroduction of Object oriented programming
introduction of Object oriented programmingRiturajJain8
 
Object Oriented Program Class 12 Computer Science
Object Oriented Program Class 12 Computer ScienceObject Oriented Program Class 12 Computer Science
Object Oriented Program Class 12 Computer ScienceShailendraPandey96
 
SE-IT JAVA LAB OOP CONCEPT
SE-IT JAVA LAB OOP CONCEPTSE-IT JAVA LAB OOP CONCEPT
SE-IT JAVA LAB OOP CONCEPTnikshaikh786
 
Object Oriented programming - Introduction
Object Oriented programming - IntroductionObject Oriented programming - Introduction
Object Oriented programming - IntroductionMadishetty Prathibha
 
Introduction to oops concepts
Introduction to oops conceptsIntroduction to oops concepts
Introduction to oops conceptsNilesh Dalvi
 
C++ in object oriented programming
C++ in object oriented programmingC++ in object oriented programming
C++ in object oriented programmingSaket Khopkar
 
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
 
Concepts of OOPs
Concepts of OOPsConcepts of OOPs
Concepts of OOPsEssay Corp
 
OOPs-Interview-Questions.pdf
OOPs-Interview-Questions.pdfOOPs-Interview-Questions.pdf
OOPs-Interview-Questions.pdfSamir Paul
 
Unit 1 introduction to c++.pptx
Unit 1 introduction to c++.pptxUnit 1 introduction to c++.pptx
Unit 1 introduction to c++.pptxshashiden1
 
gxhrehsrejhvytftfltyflytdtydtydky5dyrdtrdrdtrd
gxhrehsrejhvytftfltyflytdtydtydky5dyrdtrdrdtrdgxhrehsrejhvytftfltyflytdtydtydky5dyrdtrdrdtrd
gxhrehsrejhvytftfltyflytdtydtydky5dyrdtrdrdtrdwrushabhsirsat
 

Ähnlich wie Oop’s (20)

introduction of Object oriented programming
introduction of Object oriented programmingintroduction of Object oriented programming
introduction of Object oriented programming
 
Object Oriented Program Class 12 Computer Science
Object Oriented Program Class 12 Computer ScienceObject Oriented Program Class 12 Computer Science
Object Oriented Program Class 12 Computer Science
 
C++ chapter 1
C++ chapter 1C++ chapter 1
C++ chapter 1
 
SE-IT JAVA LAB OOP CONCEPT
SE-IT JAVA LAB OOP CONCEPTSE-IT JAVA LAB OOP CONCEPT
SE-IT JAVA LAB OOP CONCEPT
 
Object Oriented programming - Introduction
Object Oriented programming - IntroductionObject Oriented programming - Introduction
Object Oriented programming - Introduction
 
Introduction to oops concepts
Introduction to oops conceptsIntroduction to oops concepts
Introduction to oops concepts
 
object oriented programming(oops)
object oriented programming(oops)object oriented programming(oops)
object oriented programming(oops)
 
C++ in object oriented programming
C++ in object oriented programmingC++ in object oriented programming
C++ in object oriented programming
 
Oop.pptx
Oop.pptxOop.pptx
Oop.pptx
 
OOP-1.pptx
OOP-1.pptxOOP-1.pptx
OOP-1.pptx
 
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)
 
Oop lec 2
Oop lec 2Oop lec 2
Oop lec 2
 
Oop basic overview
Oop basic overviewOop basic overview
Oop basic overview
 
Concepts of OOPs
Concepts of OOPsConcepts of OOPs
Concepts of OOPs
 
Oop's
Oop'sOop's
Oop's
 
OOPs-Interview-Questions.pdf
OOPs-Interview-Questions.pdfOOPs-Interview-Questions.pdf
OOPs-Interview-Questions.pdf
 
130704798265658191
130704798265658191130704798265658191
130704798265658191
 
Bluej
BluejBluej
Bluej
 
Unit 1 introduction to c++.pptx
Unit 1 introduction to c++.pptxUnit 1 introduction to c++.pptx
Unit 1 introduction to c++.pptx
 
gxhrehsrejhvytftfltyflytdtydtydky5dyrdtrdrdtrd
gxhrehsrejhvytftfltyflytdtydtydky5dyrdtrdrdtrdgxhrehsrejhvytftfltyflytdtydtydky5dyrdtrdrdtrd
gxhrehsrejhvytftfltyflytdtydtydky5dyrdtrdrdtrd
 

Oop’s

  • 1. OOPOOPObject Oriented ProgrammingObject Oriented Programming By : Tauseef Ahmad (107)
  • 2. Evolution of OOPEvolution of OOP 1,0 Machine Language Assembly Language Procedure-Oriented Object-Oriented Programming
  • 3. Procedure-OrientedProcedure-Oriented • The primary focus is on functions. • It basically consist of list of instructions for computer to follow, and to organize these instructions into groups known as functions.
  • 4. Structure of POPStructure of POP [Procedure oriented programming][Procedure oriented programming] Main Program Function-1 Function-2 Function-3 Function-4 Function-5 Function-6 Function-7 Function-8
  • 5. Drawbacks of POPDrawbacks of POP • Most of the function share global data. • It does not model real world problem very well. Global data Global data Function-1 Function-1 Function-1 Local Data Local Data Local Data
  • 6. Object-Oriented LanguagesObject-Oriented Languages • Object-oriented programming is not the right of any particular language. • Like structured programming, OOP concept can be implemented using any language like C and Pascal.
  • 7. Object-Oriented ParadigmObject-Oriented Paradigm • Object-oriented programming (OOP) is a programming paradigm that uses "Objects" and their interactions to design applications and computer programs. • Everything around us are objects interacting with each others. • Each object has a set of features, including adjectives and verbs. • Object-oriented paradigms is sometimes thought to be a simulation of the real-world around us, which make it the paradigm of choice for most application domains: GUIs, games, business, etc.
  • 8. Basic concepts of OOPBasic concepts of OOP • Objects • Classes • Data Abstraction and Encapsulation • Inheritance • Polymorphism • Dynamic Binding • Message Passing
  • 9. ObjectsObjects • Objects are the run-time entities. • It may represent a person, a place, a bank account, a table of data or any item. • Objects take up space in the memory and have an associated address like a structure in c. • Some examples : car, man, woman etc
  • 10. ClassesClasses • A class is an abstract definition of an object. • Defines how would the object look like when created. • Think of classes like the patents of actual inventions.
  • 11. EncapsulationEncapsulation • Wrapping up of data and functions into a single unit is known as Encapsulation. • Encapsulation is hiding the functional details from the object calling it. • Can you drive a car? o Yes, I can! • So, how does acceleration work? o Huh? • Details encapsulated (hidden) from the driver.
  • 12. Data AbstractionData Abstraction • Abstraction refers to the act of representing essential features without including the background details or explanation. • An abstraction is a form of representation that includes only what is useful or interesting from a particular viewpoint. • Example : A map is an abstract representation, since no map shows every detail of the territory it covers
  • 13. InheritanceInheritance • Inheritance is the process by which objects of one class acquire the properties of objects of another class. name phoneNumber address hourlyWage WageContract() CalculateTax() PayTuition() DropCourse() Professor name phoneNumber address salary TeachCourse() CalculateTax() DevelopCourse() OR Employee name phoneNumber address CalculateTax() SupportStaff Professor TeachCourse() DevelopCourse() salary Subclasses WageContract() hourlyWage SupportStaff
  • 15. PolymorphismPolymorphism int add(int a, int b, int c) { return (a+b+c); It will return addition } of 3 integer numbers int add(int a,int b) { return (a+b); It will return addition } of 2 integer numbers float add(float a, float b, float c) { return (a+b+c); It will return addition } of 3 float numbers
  • 16. PolymorphismPolymorphism • Polymorphism is a Greek term means the ability to take more than one form. Shape Draw() Circle Object Draw (circle) Box Object Draw (box) Triangle Object Draw (triangle)
  • 17. Message PassingMessage Passing • The process by which an object: o Sends data to another object. o Asks the other object to invoke a method. • In other words, objects talk to each others via messages.
  • 18. 18 Object and Their InteractionObject and Their Interaction Program
  • 19. 19 Object and Their InteractionObject and Their Interaction Program Tom, hold your sweep!
  • 20. 20 Object and Their InteractionObject and Their Interaction Program Tom, hold your sweep! Tom, beat jerry!
  • 21. 21 Object and Their InteractionObject and Their Interaction Program Tom.holdYourSweep() Tom.BeatJerry() IN PROGRAMMING
  • 22. 22 Object and Their InteractionObject and Their Interaction Program Tom.holdYourSweep() Tom.BeatJerry() IN PROGRAMMING message
  • 23. 23 Object and Their InteractionObject and Their Interaction Program Tom.holdYourSweep() Tom.BeatJerry() IN PROGRAMMING message message