SlideShare a Scribd company logo
1 of 14
Download to read offline
05/23/08 NCACM University of Nevada, Las Vegas1
Object-Oriented Programming
Concepts
-Khursheed Mohammed
05/23/08 NCACM University of Nevada, Las Vegas2
Today’s PresentationToday’s Presentation
 What is an Object?
 What is a Class?
 What is a Message?
 Requirements of Object-Oriented language
 Step by step explanation
05/23/08 NCACM University of Nevada, Las Vegas3
What is an Object?
An object is a software bundle of related variables and methods.
Software objects are often used to model real-world objects you
find in everyday life.
Visual representation of a software object A bicycle modeled as a software object
05/23/08 NCACM University of Nevada, Las Vegas4
What is a Class?
A class is a blueprint or prototype that defines the variables and
the methods common to all objects of a certain kind.
 Class is an implementation of an abstract data type and
so encapsulates both data and operations.
 Object is run-time instance of class.
Classes just sit there, objects do the real work.
Memory is allocated for Objects not for Classes.
05/23/08 NCACM University of Nevada, Las Vegas5
What is a Message?
Software objects interact and communicate with each other
using messages.
 The object to which the message is addressed (YourBicycle)
 The name of the method to perform (changeGears)
 Any parameters needed by the method (lowerGear)
05/23/08 NCACM University of Nevada, Las Vegas6
To be object oriented, a language must support
 Encapsulation
 Inheritance
 Dynamic Binding
Some of the popular OO languages are
C++
Smalltalk
Java
Eiffel
FORTRAN90
CLOS(Common Lisp Object System)
Ada95
Modula-3
05/23/08 NCACM University of Nevada, Las Vegas7
Encapsulation:
Packaging an object's variables within the protective custody of
its methods is called encapsulation.
Often, for practical reasons, an object may wish to expose
some of its variables or hide some of its methods.
Access Levels:
XXXXPublic
XXXProtected
XPrivate
WorldPackageSubclassClassSpecifier
05/23/08 NCACM University of Nevada, Las Vegas8
What is Inheritance?
A class inherits state and behavior from its superclass. Inheritance
provides a powerful and natural mechanism for organizing and
structuring software programs.
Super Class
Subclasses
05/23/08 NCACM University of Nevada, Las Vegas9
Properties:
Each subclass inherits state (in the form of variable declarations) from the superclass.
Subclasses can add variables and methods to the ones they inherit from the superclass.
Subclasses can also override inherited methods and provide specialized implementations for
those methods.
You are not limited to just one layer of inheritance. The inheritance tree, or class hierarchy,
can be as deep as needed.
Benefits:
Re-Usability
Subclasses provide specialized behaviors from the basis of common elements provided by the
superclass. Through the use of inheritance, programmers can reuse the code in the superclass
many times.
Can define Abstract Classes
Programmers can implement superclasses called abstract classes that define "generic"
behaviors.
05/23/08 NCACM University of Nevada, Las Vegas10
A
B
C
A B
C
A-1
A-2
B-1
B-2
AB
Multi-level Inheritance Multiple Inheritance
Multiple Multi-level Inheritance
Types of Inheritance:
05/23/08 NCACM University of Nevada, Las Vegas11
Dynamic Binding:
 Dynamic binding occurs when the type of variable changes at run-time.
A common way for a variable to change its type is via assignment.
Bike:= MoutainBike is safe
MountainBike:=Bike is not safe
MountainBike is declared to have all the features of Bike so the assignment
does no harm.
 A variable that starts life of the type Bike may be attached to any object
that is a kind of Bike, including MountainBike,RacingBike,…
 A variable that starts life of the type MountainBike can only be attached
to MountainBike objects but does not include RacingBike or general Bike.
05/23/08 NCACM University of Nevada, Las Vegas12
Polymorphism:
 The ability to appear in many forms.
 In object-oriented programming, polymorphism
refers to a programming language's ability to
process objects differently depending on their
data type or class.
It is the ability to redefine methods for derived
classes.
E.g. e-bike Acceleration system.
Electronically / Mechanically
05/23/08 NCACM University of Nevada, Las Vegas13
AcknowledgementsAcknowledgements
Dr. Yitung Chen
Dr. Hsuan-Tsung (Sean) Hsieh
05/23/08 NCACM University of Nevada, Las Vegas14
CONCLUSION

More Related Content

Similar to Objectorientedprogrammingconcepts

Similar to Objectorientedprogrammingconcepts (20)

Fundamentals of JAVA
Fundamentals of JAVAFundamentals of JAVA
Fundamentals of JAVA
 
Selenium Training .pptx
Selenium Training .pptxSelenium Training .pptx
Selenium Training .pptx
 
Ooad
OoadOoad
Ooad
 
Ooad
OoadOoad
Ooad
 
Oos Short Q N
Oos Short Q NOos Short Q N
Oos Short Q N
 
OOP in Java Presentation.pptx
OOP in Java Presentation.pptxOOP in Java Presentation.pptx
OOP in Java Presentation.pptx
 
Oop
OopOop
Oop
 
Object Oriented Javascript part2
Object Oriented Javascript part2Object Oriented Javascript part2
Object Oriented Javascript part2
 
Unit 3
Unit 3Unit 3
Unit 3
 
Java notes jkuat it
Java notes jkuat itJava notes jkuat it
Java notes jkuat it
 
Java notes(OOP) jkuat IT esection
Java notes(OOP) jkuat IT esectionJava notes(OOP) jkuat IT esection
Java notes(OOP) jkuat IT esection
 
Java Interview Questions
Java Interview QuestionsJava Interview Questions
Java Interview Questions
 
Runtime Behavior of JavaScript Programs
Runtime Behavior of JavaScript ProgramsRuntime Behavior of JavaScript Programs
Runtime Behavior of JavaScript Programs
 
Adobe Flex - Foundation to Advanced (Bundle) [A-FX-103] Frameworks
Adobe Flex - Foundation to Advanced (Bundle) [A-FX-103] FrameworksAdobe Flex - Foundation to Advanced (Bundle) [A-FX-103] Frameworks
Adobe Flex - Foundation to Advanced (Bundle) [A-FX-103] Frameworks
 
EEE oops Vth semester viva questions with answer
EEE oops Vth semester viva questions with answerEEE oops Vth semester viva questions with answer
EEE oops Vth semester viva questions with answer
 
Core Java Learning Path
Core Java Learning PathCore Java Learning Path
Core Java Learning Path
 
Lecture 2 cst 205-281 oop
Lecture 2   cst 205-281 oopLecture 2   cst 205-281 oop
Lecture 2 cst 205-281 oop
 
Class notes(week 2) on basic concepts of oop-2
Class notes(week 2) on basic concepts of oop-2Class notes(week 2) on basic concepts of oop-2
Class notes(week 2) on basic concepts of oop-2
 
Cs2305 programming paradigms lecturer notes
Cs2305   programming paradigms lecturer notesCs2305   programming paradigms lecturer notes
Cs2305 programming paradigms lecturer notes
 
JAVA design patterns and Basic OOp concepts
JAVA design patterns and Basic OOp conceptsJAVA design patterns and Basic OOp concepts
JAVA design patterns and Basic OOp concepts
 

Recently uploaded

Transparency, Recognition and the role of eSealing - Ildiko Mazar and Koen No...
Transparency, Recognition and the role of eSealing - Ildiko Mazar and Koen No...Transparency, Recognition and the role of eSealing - Ildiko Mazar and Koen No...
Transparency, Recognition and the role of eSealing - Ildiko Mazar and Koen No...
EADTU
 
Contoh Aksi Nyata Refleksi Diri ( NUR ).pdf
Contoh Aksi Nyata Refleksi Diri ( NUR ).pdfContoh Aksi Nyata Refleksi Diri ( NUR ).pdf
Contoh Aksi Nyata Refleksi Diri ( NUR ).pdf
cupulin
 
SPLICE Working Group: Reusable Code Examples
SPLICE Working Group:Reusable Code ExamplesSPLICE Working Group:Reusable Code Examples
SPLICE Working Group: Reusable Code Examples
Peter Brusilovsky
 

Recently uploaded (20)

Andreas Schleicher presents at the launch of What does child empowerment mean...
Andreas Schleicher presents at the launch of What does child empowerment mean...Andreas Schleicher presents at the launch of What does child empowerment mean...
Andreas Schleicher presents at the launch of What does child empowerment mean...
 
How to Manage Website in Odoo 17 Studio App.pptx
How to Manage Website in Odoo 17 Studio App.pptxHow to Manage Website in Odoo 17 Studio App.pptx
How to Manage Website in Odoo 17 Studio App.pptx
 
What is 3 Way Matching Process in Odoo 17.pptx
What is 3 Way Matching Process in Odoo 17.pptxWhat is 3 Way Matching Process in Odoo 17.pptx
What is 3 Way Matching Process in Odoo 17.pptx
 
male presentation...pdf.................
male presentation...pdf.................male presentation...pdf.................
male presentation...pdf.................
 
Including Mental Health Support in Project Delivery, 14 May.pdf
Including Mental Health Support in Project Delivery, 14 May.pdfIncluding Mental Health Support in Project Delivery, 14 May.pdf
Including Mental Health Support in Project Delivery, 14 May.pdf
 
Michaelis Menten Equation and Estimation Of Vmax and Tmax.pptx
Michaelis Menten Equation and Estimation Of Vmax and Tmax.pptxMichaelis Menten Equation and Estimation Of Vmax and Tmax.pptx
Michaelis Menten Equation and Estimation Of Vmax and Tmax.pptx
 
UChicago CMSC 23320 - The Best Commit Messages of 2024
UChicago CMSC 23320 - The Best Commit Messages of 2024UChicago CMSC 23320 - The Best Commit Messages of 2024
UChicago CMSC 23320 - The Best Commit Messages of 2024
 
80 ĐỀ THI THỬ TUYỂN SINH TIẾNG ANH VÀO 10 SỞ GD – ĐT THÀNH PHỐ HỒ CHÍ MINH NĂ...
80 ĐỀ THI THỬ TUYỂN SINH TIẾNG ANH VÀO 10 SỞ GD – ĐT THÀNH PHỐ HỒ CHÍ MINH NĂ...80 ĐỀ THI THỬ TUYỂN SINH TIẾNG ANH VÀO 10 SỞ GD – ĐT THÀNH PHỐ HỒ CHÍ MINH NĂ...
80 ĐỀ THI THỬ TUYỂN SINH TIẾNG ANH VÀO 10 SỞ GD – ĐT THÀNH PHỐ HỒ CHÍ MINH NĂ...
 
Major project report on Tata Motors and its marketing strategies
Major project report on Tata Motors and its marketing strategiesMajor project report on Tata Motors and its marketing strategies
Major project report on Tata Motors and its marketing strategies
 
DEMONSTRATION LESSON IN ENGLISH 4 MATATAG CURRICULUM
DEMONSTRATION LESSON IN ENGLISH 4 MATATAG CURRICULUMDEMONSTRATION LESSON IN ENGLISH 4 MATATAG CURRICULUM
DEMONSTRATION LESSON IN ENGLISH 4 MATATAG CURRICULUM
 
24 ĐỀ THAM KHẢO KÌ THI TUYỂN SINH VÀO LỚP 10 MÔN TIẾNG ANH SỞ GIÁO DỤC HẢI DƯ...
24 ĐỀ THAM KHẢO KÌ THI TUYỂN SINH VÀO LỚP 10 MÔN TIẾNG ANH SỞ GIÁO DỤC HẢI DƯ...24 ĐỀ THAM KHẢO KÌ THI TUYỂN SINH VÀO LỚP 10 MÔN TIẾNG ANH SỞ GIÁO DỤC HẢI DƯ...
24 ĐỀ THAM KHẢO KÌ THI TUYỂN SINH VÀO LỚP 10 MÔN TIẾNG ANH SỞ GIÁO DỤC HẢI DƯ...
 
Transparency, Recognition and the role of eSealing - Ildiko Mazar and Koen No...
Transparency, Recognition and the role of eSealing - Ildiko Mazar and Koen No...Transparency, Recognition and the role of eSealing - Ildiko Mazar and Koen No...
Transparency, Recognition and the role of eSealing - Ildiko Mazar and Koen No...
 
Spring gala 2024 photo slideshow - Celebrating School-Community Partnerships
Spring gala 2024 photo slideshow - Celebrating School-Community PartnershipsSpring gala 2024 photo slideshow - Celebrating School-Community Partnerships
Spring gala 2024 photo slideshow - Celebrating School-Community Partnerships
 
Mattingly "AI & Prompt Design: Named Entity Recognition"
Mattingly "AI & Prompt Design: Named Entity Recognition"Mattingly "AI & Prompt Design: Named Entity Recognition"
Mattingly "AI & Prompt Design: Named Entity Recognition"
 
Contoh Aksi Nyata Refleksi Diri ( NUR ).pdf
Contoh Aksi Nyata Refleksi Diri ( NUR ).pdfContoh Aksi Nyata Refleksi Diri ( NUR ).pdf
Contoh Aksi Nyata Refleksi Diri ( NUR ).pdf
 
diagnosting testing bsc 2nd sem.pptx....
diagnosting testing bsc 2nd sem.pptx....diagnosting testing bsc 2nd sem.pptx....
diagnosting testing bsc 2nd sem.pptx....
 
SPLICE Working Group: Reusable Code Examples
SPLICE Working Group:Reusable Code ExamplesSPLICE Working Group:Reusable Code Examples
SPLICE Working Group: Reusable Code Examples
 
Mattingly "AI and Prompt Design: LLMs with NER"
Mattingly "AI and Prompt Design: LLMs with NER"Mattingly "AI and Prompt Design: LLMs with NER"
Mattingly "AI and Prompt Design: LLMs with NER"
 
8 Tips for Effective Working Capital Management
8 Tips for Effective Working Capital Management8 Tips for Effective Working Capital Management
8 Tips for Effective Working Capital Management
 
HMCS Vancouver Pre-Deployment Brief - May 2024 (Web Version).pptx
HMCS Vancouver Pre-Deployment Brief - May 2024 (Web Version).pptxHMCS Vancouver Pre-Deployment Brief - May 2024 (Web Version).pptx
HMCS Vancouver Pre-Deployment Brief - May 2024 (Web Version).pptx
 

Objectorientedprogrammingconcepts

  • 1. 05/23/08 NCACM University of Nevada, Las Vegas1 Object-Oriented Programming Concepts -Khursheed Mohammed
  • 2. 05/23/08 NCACM University of Nevada, Las Vegas2 Today’s PresentationToday’s Presentation  What is an Object?  What is a Class?  What is a Message?  Requirements of Object-Oriented language  Step by step explanation
  • 3. 05/23/08 NCACM University of Nevada, Las Vegas3 What is an Object? An object is a software bundle of related variables and methods. Software objects are often used to model real-world objects you find in everyday life. Visual representation of a software object A bicycle modeled as a software object
  • 4. 05/23/08 NCACM University of Nevada, Las Vegas4 What is a Class? A class is a blueprint or prototype that defines the variables and the methods common to all objects of a certain kind.  Class is an implementation of an abstract data type and so encapsulates both data and operations.  Object is run-time instance of class. Classes just sit there, objects do the real work. Memory is allocated for Objects not for Classes.
  • 5. 05/23/08 NCACM University of Nevada, Las Vegas5 What is a Message? Software objects interact and communicate with each other using messages.  The object to which the message is addressed (YourBicycle)  The name of the method to perform (changeGears)  Any parameters needed by the method (lowerGear)
  • 6. 05/23/08 NCACM University of Nevada, Las Vegas6 To be object oriented, a language must support  Encapsulation  Inheritance  Dynamic Binding Some of the popular OO languages are C++ Smalltalk Java Eiffel FORTRAN90 CLOS(Common Lisp Object System) Ada95 Modula-3
  • 7. 05/23/08 NCACM University of Nevada, Las Vegas7 Encapsulation: Packaging an object's variables within the protective custody of its methods is called encapsulation. Often, for practical reasons, an object may wish to expose some of its variables or hide some of its methods. Access Levels: XXXXPublic XXXProtected XPrivate WorldPackageSubclassClassSpecifier
  • 8. 05/23/08 NCACM University of Nevada, Las Vegas8 What is Inheritance? A class inherits state and behavior from its superclass. Inheritance provides a powerful and natural mechanism for organizing and structuring software programs. Super Class Subclasses
  • 9. 05/23/08 NCACM University of Nevada, Las Vegas9 Properties: Each subclass inherits state (in the form of variable declarations) from the superclass. Subclasses can add variables and methods to the ones they inherit from the superclass. Subclasses can also override inherited methods and provide specialized implementations for those methods. You are not limited to just one layer of inheritance. The inheritance tree, or class hierarchy, can be as deep as needed. Benefits: Re-Usability Subclasses provide specialized behaviors from the basis of common elements provided by the superclass. Through the use of inheritance, programmers can reuse the code in the superclass many times. Can define Abstract Classes Programmers can implement superclasses called abstract classes that define "generic" behaviors.
  • 10. 05/23/08 NCACM University of Nevada, Las Vegas10 A B C A B C A-1 A-2 B-1 B-2 AB Multi-level Inheritance Multiple Inheritance Multiple Multi-level Inheritance Types of Inheritance:
  • 11. 05/23/08 NCACM University of Nevada, Las Vegas11 Dynamic Binding:  Dynamic binding occurs when the type of variable changes at run-time. A common way for a variable to change its type is via assignment. Bike:= MoutainBike is safe MountainBike:=Bike is not safe MountainBike is declared to have all the features of Bike so the assignment does no harm.  A variable that starts life of the type Bike may be attached to any object that is a kind of Bike, including MountainBike,RacingBike,…  A variable that starts life of the type MountainBike can only be attached to MountainBike objects but does not include RacingBike or general Bike.
  • 12. 05/23/08 NCACM University of Nevada, Las Vegas12 Polymorphism:  The ability to appear in many forms.  In object-oriented programming, polymorphism refers to a programming language's ability to process objects differently depending on their data type or class. It is the ability to redefine methods for derived classes. E.g. e-bike Acceleration system. Electronically / Mechanically
  • 13. 05/23/08 NCACM University of Nevada, Las Vegas13 AcknowledgementsAcknowledgements Dr. Yitung Chen Dr. Hsuan-Tsung (Sean) Hsieh
  • 14. 05/23/08 NCACM University of Nevada, Las Vegas14 CONCLUSION