SlideShare ist ein Scribd-Unternehmen logo
1 von 35
Java is an Object-Oriented Language ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Objects everywhere... Real world entities
World ,[object Object],[object Object],[object Object],[object Object],[object Object]
Describing the world ,[object Object],[object Object],[object Object],[object Object],[object Object]
Objects have identity... Our house The neighbour’s cat Hasan’s computer Merhababen Ayse My book Dombo the elephant
Objects have state... Red Lying Happy Hooked ill Broken
Objects have behavior…. Grrrrrrrr Vroemm Hello,  I am John Nice to  meet you da da …
Object Properties ,[object Object],[object Object],[object Object],myLamp on off Object is an abstraction of a real world entity
Introduction to Objects ,[object Object],[object Object],[object Object],[object Object],[object Object]
Objects and Classes Bank   Account A class (the concept) John’s Bank Account Balance: $5,257 An object (the realization) Bill’s Bank Account Balance: $1,245,069 Mary’s Bank Account Balance: $16,833 Multiple objects from the same class
Java OOP terminology ,[object Object],[object Object],[object Object],data methods ,[object Object],[object Object],[object Object]
Java OOP Software ,[object Object],[object Object],[object Object],One object will send a message to another object asking it to do a particular task. The first object does not need to know how the task is done (only how to request that it be done.) This corresponds to calling one of the  second object’s methods! Created (instantiated) from class definitions Person “ David” David: Say your name Ayse David
Abstraction ,[object Object],[object Object],[object Object],[object Object],[object Object],Abstraction A car consists of four wheels an engine, accumulator and brakes.
Multiple Abstractions ,[object Object],[object Object],[object Object],[object Object],[object Object]
Choosing Abstractions ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Object-Oriented Model methods data Object boundary
Example: Pencil location direction penDown home up down write
Encapsulation ,[object Object],[object Object],[object Object],[object Object],location direction penDown home up down write public private
Programming Implications ,[object Object],[object Object],[object Object],[object Object]
Car Objects
Defining class Car ,[object Object],[object Object]
Class Car  Car color speed power drive turn right turn left stop attributes operations class name
in Java Car String  color int  speed int  power drive() turnRight() turnLeft() stop() attributes or  instance variables methods class name
Java 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],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],Car String  color int  speed int  power drive() turnRight() turnLeft() stop()
Class Pencil Pencil int location String direction home() up() down() write() attributes methods Name
Declaring objects ,[object Object],[object Object],Car String  color int  speed int  power drive() turnRight() turnLeft() stop() new
Java's "Building Blocks" ,[object Object],[object Object],[object Object],[object Object],[object Object]
Primitive Data ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Declaring object variables ,[object Object],[object Object],[object Object]
Declaring Objects Class Person ayse; Person String name String birthDate int age getName() getAge … . ayse is of Class
Creating Objects ,[object Object],ayse = new Person(); ,[object Object],[object Object],[object Object],ayse Class Object instance of refers to Person ayse = new Person(); is of Class Person String name String birthDate int age getName() getAge … .
Declaring and Creating Objects Class karanfil = new Flower(); Flower karanfil; Flower int age int length int weight getAge() getLength() … . Object instance of refers to karanfil is of Class
Basic approach ,[object Object],[object Object],[object Object],[object Object]
Using objects ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Example ayse Class Object instance of refers to is of Class ayse = new Person(); Person ayse; ayse.setName( “Ayse Engin“) ; ayse.setAge(24); Person String name String birthDate int age setName(String name) setAge(int age) getName() … . Ayse Engin 24

Weitere ähnliche Inhalte

Was ist angesagt?

Lect 1-class and object
Lect 1-class and objectLect 1-class and object
Lect 1-class and object
Fajar Baskoro
 
Object oriented architecture in erp
Object  oriented architecture in erpObject  oriented architecture in erp
Object oriented architecture in erp
Preyanshu Saini
 
Oops Concept Java
Oops Concept JavaOops Concept Java
Oops Concept Java
Kamlesh Singh
 
Oop c++class(final).ppt
Oop c++class(final).pptOop c++class(final).ppt
Oop c++class(final).ppt
Alok Kumar
 
Introduction to object oriented programming
Introduction to object oriented programmingIntroduction to object oriented programming
Introduction to object oriented programming
Abzetdin Adamov
 
Oop Presentation
Oop PresentationOop Presentation
Oop Presentation
Ghaffar Khan
 
Lecture 1 oop
Lecture 1 oopLecture 1 oop
Lecture 1 oop
Tony Apreku
 

Was ist angesagt? (20)

Introduction to OOP concepts
Introduction to OOP conceptsIntroduction to OOP concepts
Introduction to OOP 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
 
Static keyword ppt
Static keyword pptStatic keyword ppt
Static keyword ppt
 
OOPS in Java
OOPS in JavaOOPS in Java
OOPS in Java
 
Classes and objects
Classes and objectsClasses and objects
Classes and objects
 
Lect 1-class and object
Lect 1-class and objectLect 1-class and object
Lect 1-class and object
 
Object Oriented Paradigm
Object Oriented ParadigmObject Oriented Paradigm
Object Oriented Paradigm
 
Object oriented architecture in erp
Object  oriented architecture in erpObject  oriented architecture in erp
Object oriented architecture in erp
 
Classes objects in java
Classes objects in javaClasses objects in java
Classes objects in java
 
Oops Concept Java
Oops Concept JavaOops Concept Java
Oops Concept Java
 
Oop c++class(final).ppt
Oop c++class(final).pptOop c++class(final).ppt
Oop c++class(final).ppt
 
Java Programming Paradigms Chapter 1
Java Programming Paradigms Chapter 1 Java Programming Paradigms Chapter 1
Java Programming Paradigms Chapter 1
 
Java data types, variables and jvm
Java data types, variables and jvm Java data types, variables and jvm
Java data types, variables and jvm
 
Introduction to object oriented programming
Introduction to object oriented programmingIntroduction to object oriented programming
Introduction to object oriented programming
 
C# by Zaheer Abbas Aghani
C# by Zaheer Abbas AghaniC# by Zaheer Abbas Aghani
C# by Zaheer Abbas Aghani
 
Classes&objects
Classes&objectsClasses&objects
Classes&objects
 
Java basics and java variables
Java basics and java variablesJava basics and java variables
Java basics and java variables
 
Oop Presentation
Oop PresentationOop Presentation
Oop Presentation
 
Lecture 1 oop
Lecture 1 oopLecture 1 oop
Lecture 1 oop
 
Object-oriented concepts
Object-oriented conceptsObject-oriented concepts
Object-oriented concepts
 

Ă„hnlich wie Java is an Object-Oriented Language

Hibernate Training Session1
Hibernate Training Session1Hibernate Training Session1
Hibernate Training Session1
Asad Khan
 
OOP programming
OOP programmingOOP programming
OOP programming
anhdbh
 
Object Oriented Design
Object Oriented DesignObject Oriented Design
Object Oriented Design
Aravinth NSP
 
Object-Oriented Concepts
Object-Oriented ConceptsObject-Oriented Concepts
Object-Oriented Concepts
Abdalla Mahmoud
 

Ă„hnlich wie Java is an Object-Oriented Language (20)

COMP111-Week-1_138439.pptx
COMP111-Week-1_138439.pptxCOMP111-Week-1_138439.pptx
COMP111-Week-1_138439.pptx
 
Hibernate Training Session1
Hibernate Training Session1Hibernate Training Session1
Hibernate Training Session1
 
Classes-and-Object.pptx
Classes-and-Object.pptxClasses-and-Object.pptx
Classes-and-Object.pptx
 
Lecture 4
Lecture 4Lecture 4
Lecture 4
 
OOP programming
OOP programmingOOP programming
OOP programming
 
Java Progamming Paradigms, OOPS Concept, Introduction to Java, Structure of J...
Java Progamming Paradigms, OOPS Concept, Introduction to Java, Structure of J...Java Progamming Paradigms, OOPS Concept, Introduction to Java, Structure of J...
Java Progamming Paradigms, OOPS Concept, Introduction to Java, Structure of J...
 
javaopps concepts
javaopps conceptsjavaopps concepts
javaopps concepts
 
Object Oriented Design
Object Oriented DesignObject Oriented Design
Object Oriented Design
 
Object Oriented Design
Object Oriented DesignObject Oriented Design
Object Oriented Design
 
07slide.ppt
07slide.ppt07slide.ppt
07slide.ppt
 
O6u CS-315A OOP Lecture (1).pdf
O6u CS-315A OOP Lecture (1).pdfO6u CS-315A OOP Lecture (1).pdf
O6u CS-315A OOP Lecture (1).pdf
 
JAVA-PPT'S.pdf
JAVA-PPT'S.pdfJAVA-PPT'S.pdf
JAVA-PPT'S.pdf
 
Lecture 01 - Basic Concept About OOP With Python
Lecture 01 - Basic Concept About OOP With PythonLecture 01 - Basic Concept About OOP With Python
Lecture 01 - Basic Concept About OOP With Python
 
Ooad notes
Ooad notesOoad notes
Ooad notes
 
java tr.docx
java tr.docxjava tr.docx
java tr.docx
 
Java: Objects and Object References
Java: Objects and Object ReferencesJava: Objects and Object References
Java: Objects and Object References
 
Object-Oriented Concepts
Object-Oriented ConceptsObject-Oriented Concepts
Object-Oriented Concepts
 
Advance oops concepts
Advance oops conceptsAdvance oops concepts
Advance oops concepts
 
2.oop concept
2.oop concept2.oop concept
2.oop concept
 
Seminar
SeminarSeminar
Seminar
 

Mehr von ale8819 (11)

Disco Duro
Disco DuroDisco Duro
Disco Duro
 
Fuentes De Campos Magnéticos
Fuentes De Campos MagnéticosFuentes De Campos Magnéticos
Fuentes De Campos Magnéticos
 
AWT- JAVA
AWT- JAVAAWT- JAVA
AWT- JAVA
 
Manejo de eventos
Manejo de eventosManejo de eventos
Manejo de eventos
 
Appleofdiscord
AppleofdiscordAppleofdiscord
Appleofdiscord
 
Qubits
QubitsQubits
Qubits
 
Magnetismo
MagnetismoMagnetismo
Magnetismo
 
JAVA
JAVAJAVA
JAVA
 
Excepciones
ExcepcionesExcepciones
Excepciones
 
programacion orientada a objetos
programacion orientada a objetosprogramacion orientada a objetos
programacion orientada a objetos
 
pci
pcipci
pci
 

KĂĽrzlich hochgeladen

Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
WSO2
 

KĂĽrzlich hochgeladen (20)

Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : Uncertainty
 
ICT role in 21st century education and its challenges
ICT role in 21st century education and its challengesICT role in 21st century education and its challenges
ICT role in 21st century education and its challenges
 
DBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor Presentation
 
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
Manulife - Insurer Transformation Award 2024
Manulife - Insurer Transformation Award 2024Manulife - Insurer Transformation Award 2024
Manulife - Insurer Transformation Award 2024
 
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
Ransomware_Q4_2023. The report. [EN].pdf
Ransomware_Q4_2023. The report. [EN].pdfRansomware_Q4_2023. The report. [EN].pdf
Ransomware_Q4_2023. The report. [EN].pdf
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
 
AXA XL - Insurer Innovation Award Americas 2024
AXA XL - Insurer Innovation Award Americas 2024AXA XL - Insurer Innovation Award Americas 2024
AXA XL - Insurer Innovation Award Americas 2024
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
Navi Mumbai Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Navi Mumbai Call Girls 🥰 8617370543 Service Offer VIP Hot ModelNavi Mumbai Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Navi Mumbai Call Girls 🥰 8617370543 Service Offer VIP Hot Model
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024
 

Java is an Object-Oriented Language

  • 1.
  • 2. Objects everywhere... Real world entities
  • 3.
  • 4.
  • 5. Objects have identity... Our house The neighbour’s cat Hasan’s computer Merhababen Ayse My book Dombo the elephant
  • 6. Objects have state... Red Lying Happy Hooked ill Broken
  • 7. Objects have behavior…. Grrrrrrrr Vroemm Hello, I am John Nice to meet you da da …
  • 8.
  • 9.
  • 10. Objects and Classes Bank Account A class (the concept) John’s Bank Account Balance: $5,257 An object (the realization) Bill’s Bank Account Balance: $1,245,069 Mary’s Bank Account Balance: $16,833 Multiple objects from the same class
  • 11.
  • 12.
  • 13.
  • 14.
  • 15.
  • 16. Object-Oriented Model methods data Object boundary
  • 17. Example: Pencil location direction penDown home up down write
  • 18.
  • 19.
  • 21.
  • 22. Class Car Car color speed power drive turn right turn left stop attributes operations class name
  • 23. in Java Car String color int speed int power drive() turnRight() turnLeft() stop() attributes or instance variables methods class name
  • 24.
  • 25. Class Pencil Pencil int location String direction home() up() down() write() attributes methods Name
  • 26.
  • 27.
  • 28.
  • 29.
  • 30. Declaring Objects Class Person ayse; Person String name String birthDate int age getName() getAge … . ayse is of Class
  • 31.
  • 32. Declaring and Creating Objects Class karanfil = new Flower(); Flower karanfil; Flower int age int length int weight getAge() getLength() … . Object instance of refers to karanfil is of Class
  • 33.
  • 34.
  • 35. Example ayse Class Object instance of refers to is of Class ayse = new Person(); Person ayse; ayse.setName( “Ayse Engin“) ; ayse.setAge(24); Person String name String birthDate int age setName(String name) setAge(int age) getName() … . Ayse Engin 24