SlideShare a Scribd company logo
Java is an Object-Oriented Language In structured programming languages, methods define the structure of the programs, they are basic building blocks Data has secondary role, it is just something that is passed around. In object oriented languages, the data has the principal role Methods belong to the data, without the data, the method does not have any meaning (Except static methods) Data and methods together make up the object. OOP tries to model the real world. What does the real world look like?
Objects everywhere... Real world entities
World The world is  a set of things interacting with each other. OOP is more natural to humans, but less natural to computers Computers (usually) have a single thread of control, so objects take turns
Describing the world Describe a particular person Ayse has long blond hair, green eyes, is 1.63m tall, weighs 56Kg and studies computer engineering. Now lying down asleep. Mehmet studies electronics, has short black hair and brown eyes. He is 180cm and 75 kilos. Now running to class! Notice how all have specific values of name, height, weight, eye colour, state, …
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 Identity State Behavior myLamp on off Object is an abstraction of a real world entity
Introduction to Objects An  object  represents something with which we can interact in a program An object provides a collection of services that we can tell it to perform for us The services are defined by methods in a  class  that defines the object A class represents a concept, and an object represents the embodiment of a class A class can be used to create multiple objects
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 Class  - Category Properties/states Functionality/Services (examines/alters state) data methods object  - Individual/unique thing (an instance of a class) Particular value for each property/state & functionality of all members of class.
Java OOP Software Software System Set of objects  Which interact with each other 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 An  abstraction  hides (or ignores) unnecessary details  denotes the essential properties of an object One of the fundamental ways in which we handle complexity Objects are abstractions of real world entities Programming goal: choose the right abstractions Abstraction A car consists of four wheels an engine, accumulator and brakes.
Multiple Abstractions A single thing can have multiple abstractions Example: a protein is… a sequence of amino acids a complicated 3D shape (a fold) a surface with “pockets” for ligands
Choosing Abstractions Abstractions can be about tangible things (a vehicle, a car, a map) or intangible things (a meeting, a route, a schedule) An example: Abstraction name: light Light’s wattage (i.e.,energy usage) Light can be on or off There are other possible properties (shape, color, socket size, etc.), but we have decided those are less essential The essential properties are determined by the problem
Object-Oriented Model methods data Object boundary
Example: Pencil location direction penDown home up down write
Encapsulation the data belonging to an object is hidden, so variables are  private methods are  public we use the public methods to change or access the private data No dependence on implementation location direction penDown home up down write public private
Programming Implications Encapsulation makes programming easier As long as the contract is the same, the client doesn’t care about the implementation In Java, as long as the method signatures are the same, the implementation details can be changed In other words, I can write my program using simple implementations; then, if necessary, I can replace some of the simple implementations with efficient implementations
Car Objects
Defining class Car What are the common attributes of cars? What are the common behaviors of cars?
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 public class Car { // attribute declarations private String color; private int speed; private int power; // method declarations public void drive() {  // …. } public void turnRight() {  // …. } public void turnLeft() {  // …. } public void stop() {  // …. } } 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 A class can be used to  create  objects Objects are the instances of that class Car String  color int  speed int  power drive() turnRight() turnLeft() stop() new
Java's "Building Blocks" Data types  primitive constructs (e.g., integers, floating point numbers, characters) Class  A description of a set of objects used to create objects
Primitive Data There are exactly eight primitive data types in Java Four of them represent integers: byte ,  short ,  int ,  long Two of them represent floating point numbers: float ,  double One of them represents characters: char And one of them represents boolean values: boolean
Declaring object variables A class name can be used as a type to declare an  object reference variable Person ayse; An object reference variable holds the address of an object
Declaring Objects Class Person ayse; Person String name String birthDate int age getName() getAge … . ayse is of Class
Creating Objects We use the  new  operator to create an object ayse = new Person(); Creating an object is called  instantiation An object is an  instance  of a particular class We can combine declaration and creation: 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 Define class Declare objects Create objects Use objects
Using objects The way you work with objects is to send them messages Most statements using objects have the following structure object.method for example:  thisPerson.setAge(24); This means the object whose name is  thisPerson is sent the message  setAge() along with the "value" 24 The effect of this is to set the person's age to be 24 years old
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

More Related Content

What's hot (20)

Introduction to OOP concepts
Introduction to OOP conceptsIntroduction to OOP concepts
Introduction to OOP concepts
Ahmed Farag
 
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
Adil Kakakhel
 
Static keyword ppt
Static keyword pptStatic keyword ppt
Static keyword ppt
Vinod Kumar
 
OOPS in Java
OOPS in JavaOOPS in Java
OOPS in Java
Zeeshan Khan
 
Classes and objects
Classes and objectsClasses and objects
Classes and objects
Anil Kumar
 
Lect 1-class and object
Lect 1-class and objectLect 1-class and object
Lect 1-class and object
Fajar Baskoro
 
Object Oriented Paradigm
Object Oriented ParadigmObject Oriented Paradigm
Object Oriented Paradigm
Hüseyin Ergin
 
Object oriented architecture in erp
Object  oriented architecture in erpObject  oriented architecture in erp
Object oriented architecture in erp
Preyanshu Saini
 
Classes objects in java
Classes objects in javaClasses objects in java
Classes objects in java
Madishetty Prathibha
 
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
 
Java Programming Paradigms Chapter 1
Java Programming Paradigms Chapter 1 Java Programming Paradigms Chapter 1
Java Programming Paradigms Chapter 1
Sakthi Durai
 
Java data types, variables and jvm
Java data types, variables and jvm Java data types, variables and jvm
Java data types, variables and jvm
Madishetty Prathibha
 
Introduction to object oriented programming
Introduction to object oriented programmingIntroduction to object oriented programming
Introduction to object oriented programming
Abzetdin Adamov
 
C# by Zaheer Abbas Aghani
C# by Zaheer Abbas AghaniC# by Zaheer Abbas Aghani
C# by Zaheer Abbas Aghani
Information Technology Center
 
Classes&objects
Classes&objectsClasses&objects
Classes&objects
M Vishnuvardhan Reddy
 
Java basics and java variables
Java basics and java variablesJava basics and java variables
Java basics and java variables
Pushpendra Tyagi
 
Oop Presentation
Oop PresentationOop Presentation
Oop Presentation
Ghaffar Khan
 
Lecture 1 oop
Lecture 1 oopLecture 1 oop
Lecture 1 oop
Tony Apreku
 
Object-oriented concepts
Object-oriented conceptsObject-oriented concepts
Object-oriented concepts
BG Java EE Course
 
Introduction to OOP concepts
Introduction to OOP conceptsIntroduction to OOP concepts
Introduction to OOP concepts
Ahmed Farag
 
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
Adil Kakakhel
 
Static keyword ppt
Static keyword pptStatic keyword ppt
Static keyword ppt
Vinod Kumar
 
Classes and objects
Classes and objectsClasses and objects
Classes and objects
Anil Kumar
 
Lect 1-class and object
Lect 1-class and objectLect 1-class and object
Lect 1-class and object
Fajar Baskoro
 
Object Oriented Paradigm
Object Oriented ParadigmObject Oriented Paradigm
Object Oriented Paradigm
Hüseyin Ergin
 
Object oriented architecture in erp
Object  oriented architecture in erpObject  oriented architecture in erp
Object oriented architecture in erp
Preyanshu Saini
 
Oop c++class(final).ppt
Oop c++class(final).pptOop c++class(final).ppt
Oop c++class(final).ppt
Alok Kumar
 
Java Programming Paradigms Chapter 1
Java Programming Paradigms Chapter 1 Java Programming Paradigms Chapter 1
Java Programming Paradigms Chapter 1
Sakthi Durai
 
Java data types, variables and jvm
Java data types, variables and jvm Java data types, variables and jvm
Java data types, variables and jvm
Madishetty Prathibha
 
Introduction to object oriented programming
Introduction to object oriented programmingIntroduction to object oriented programming
Introduction to object oriented programming
Abzetdin Adamov
 
Java basics and java variables
Java basics and java variablesJava basics and java variables
Java basics and java variables
Pushpendra Tyagi
 

Similar to Java is an Object-Oriented Language (20)

UNIT I OOP AND JAVA FUNDAMENTALS CONSTRUCTOR
UNIT I 	OOP AND JAVA FUNDAMENTALS CONSTRUCTORUNIT I 	OOP AND JAVA FUNDAMENTALS CONSTRUCTOR
UNIT I OOP AND JAVA FUNDAMENTALS CONSTRUCTOR
mohanrajm63
 
CS8392-OOPS-Printed-Notes-All-Units.pdf for students
CS8392-OOPS-Printed-Notes-All-Units.pdf for studentsCS8392-OOPS-Printed-Notes-All-Units.pdf for students
CS8392-OOPS-Printed-Notes-All-Units.pdf for students
KaviShetty
 
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...
Sakthi Durai
 
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
Kuntal Bhowmick
 
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
Kuntal Bhowmick
 
Md02 - Getting Started part-2
Md02 - Getting Started part-2Md02 - Getting Started part-2
Md02 - Getting Started part-2
Rakesh Madugula
 
Android Training (Java Review)
Android Training (Java Review)Android Training (Java Review)
Android Training (Java Review)
Khaled Anaqwa
 
Oops concepts
Oops conceptsOops concepts
Oops concepts
ACCESS Health Digital
 
JAVA-PPT'S.pdf
JAVA-PPT'S.pdfJAVA-PPT'S.pdf
JAVA-PPT'S.pdf
AnmolVerma363503
 
Object Oriented Programming Tutorial.pptx
Object Oriented Programming Tutorial.pptxObject Oriented Programming Tutorial.pptx
Object Oriented Programming Tutorial.pptx
ethiouniverse
 
Object Oriented Programming All Unit Notes
Object Oriented Programming All Unit NotesObject Oriented Programming All Unit Notes
Object Oriented Programming All Unit Notes
BalamuruganV28
 
Java Object-Oriented Programming Conecpts(Real-Time) Examples
Java Object-Oriented Programming Conecpts(Real-Time) ExamplesJava Object-Oriented Programming Conecpts(Real-Time) Examples
Java Object-Oriented Programming Conecpts(Real-Time) Examples
Shridhar Ramesh
 
JAVA-PPT'S-complete-chrome.pptx
JAVA-PPT'S-complete-chrome.pptxJAVA-PPT'S-complete-chrome.pptx
JAVA-PPT'S-complete-chrome.pptx
KunalYadav65140
 
JAVA-PPT'S.pptx
JAVA-PPT'S.pptxJAVA-PPT'S.pptx
JAVA-PPT'S.pptx
RaazIndia
 
javaopps concepts
javaopps conceptsjavaopps concepts
javaopps concepts
Nikhil Agrawal
 
Java Programming - UNIT - 1, Basics OOPS, Differences
Java Programming - UNIT - 1, Basics OOPS, DifferencesJava Programming - UNIT - 1, Basics OOPS, Differences
Java Programming - UNIT - 1, Basics OOPS, Differences
PradeepT42
 
Complete Java Course
Complete Java CourseComplete Java Course
Complete Java Course
Lhouceine OUHAMZA
 
M.c.a. (sem iv)- java programming
M.c.a. (sem   iv)- java programmingM.c.a. (sem   iv)- java programming
M.c.a. (sem iv)- java programming
Praveen Chowdary
 
Programming Laboratory Unit 1.pdf
Programming Laboratory Unit 1.pdfProgramming Laboratory Unit 1.pdf
Programming Laboratory Unit 1.pdf
swapnilslide2019
 
Introduction to Java Object Oiented Concepts and Basic terminologies
Introduction to Java Object Oiented Concepts and Basic terminologiesIntroduction to Java Object Oiented Concepts and Basic terminologies
Introduction to Java Object Oiented Concepts and Basic terminologies
TabassumMaktum
 
UNIT I OOP AND JAVA FUNDAMENTALS CONSTRUCTOR
UNIT I 	OOP AND JAVA FUNDAMENTALS CONSTRUCTORUNIT I 	OOP AND JAVA FUNDAMENTALS CONSTRUCTOR
UNIT I OOP AND JAVA FUNDAMENTALS CONSTRUCTOR
mohanrajm63
 
CS8392-OOPS-Printed-Notes-All-Units.pdf for students
CS8392-OOPS-Printed-Notes-All-Units.pdf for studentsCS8392-OOPS-Printed-Notes-All-Units.pdf for students
CS8392-OOPS-Printed-Notes-All-Units.pdf for students
KaviShetty
 
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...
Sakthi Durai
 
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
Kuntal Bhowmick
 
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
Kuntal Bhowmick
 
Md02 - Getting Started part-2
Md02 - Getting Started part-2Md02 - Getting Started part-2
Md02 - Getting Started part-2
Rakesh Madugula
 
Android Training (Java Review)
Android Training (Java Review)Android Training (Java Review)
Android Training (Java Review)
Khaled Anaqwa
 
Object Oriented Programming Tutorial.pptx
Object Oriented Programming Tutorial.pptxObject Oriented Programming Tutorial.pptx
Object Oriented Programming Tutorial.pptx
ethiouniverse
 
Object Oriented Programming All Unit Notes
Object Oriented Programming All Unit NotesObject Oriented Programming All Unit Notes
Object Oriented Programming All Unit Notes
BalamuruganV28
 
Java Object-Oriented Programming Conecpts(Real-Time) Examples
Java Object-Oriented Programming Conecpts(Real-Time) ExamplesJava Object-Oriented Programming Conecpts(Real-Time) Examples
Java Object-Oriented Programming Conecpts(Real-Time) Examples
Shridhar Ramesh
 
JAVA-PPT'S-complete-chrome.pptx
JAVA-PPT'S-complete-chrome.pptxJAVA-PPT'S-complete-chrome.pptx
JAVA-PPT'S-complete-chrome.pptx
KunalYadav65140
 
JAVA-PPT'S.pptx
JAVA-PPT'S.pptxJAVA-PPT'S.pptx
JAVA-PPT'S.pptx
RaazIndia
 
Java Programming - UNIT - 1, Basics OOPS, Differences
Java Programming - UNIT - 1, Basics OOPS, DifferencesJava Programming - UNIT - 1, Basics OOPS, Differences
Java Programming - UNIT - 1, Basics OOPS, Differences
PradeepT42
 
M.c.a. (sem iv)- java programming
M.c.a. (sem   iv)- java programmingM.c.a. (sem   iv)- java programming
M.c.a. (sem iv)- java programming
Praveen Chowdary
 
Programming Laboratory Unit 1.pdf
Programming Laboratory Unit 1.pdfProgramming Laboratory Unit 1.pdf
Programming Laboratory Unit 1.pdf
swapnilslide2019
 
Introduction to Java Object Oiented Concepts and Basic terminologies
Introduction to Java Object Oiented Concepts and Basic terminologiesIntroduction to Java Object Oiented Concepts and Basic terminologies
Introduction to Java Object Oiented Concepts and Basic terminologies
TabassumMaktum
 
Ad

More from ale8819 (11)

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

Recently uploaded (20)

Mastering AI Workflows with FME - Peak of Data & AI 2025
Mastering AI Workflows with FME - Peak of Data & AI 2025Mastering AI Workflows with FME - Peak of Data & AI 2025
Mastering AI Workflows with FME - Peak of Data & AI 2025
Safe Software
 
7 Salesforce Data Cloud Best Practices.pdf
7 Salesforce Data Cloud Best Practices.pdf7 Salesforce Data Cloud Best Practices.pdf
7 Salesforce Data Cloud Best Practices.pdf
Minuscule Technologies
 
Domino IQ – What to Expect, First Steps and Use Cases
Domino IQ – What to Expect, First Steps and Use CasesDomino IQ – What to Expect, First Steps and Use Cases
Domino IQ – What to Expect, First Steps and Use Cases
panagenda
 
DevOps in the Modern Era - Thoughtfully Critical Podcast
DevOps in the Modern Era - Thoughtfully Critical PodcastDevOps in the Modern Era - Thoughtfully Critical Podcast
DevOps in the Modern Era - Thoughtfully Critical Podcast
Chris Wahl
 
Soulmaite review - Find Real AI soulmate review
Soulmaite review - Find Real AI soulmate reviewSoulmaite review - Find Real AI soulmate review
Soulmaite review - Find Real AI soulmate review
Soulmaite
 
ISOIEC 42005 Revolutionalises AI Impact Assessment.pptx
ISOIEC 42005 Revolutionalises AI Impact Assessment.pptxISOIEC 42005 Revolutionalises AI Impact Assessment.pptx
ISOIEC 42005 Revolutionalises AI Impact Assessment.pptx
AyilurRamnath1
 
Oracle Cloud Infrastructure Generative AI Professional
Oracle Cloud Infrastructure Generative AI ProfessionalOracle Cloud Infrastructure Generative AI Professional
Oracle Cloud Infrastructure Generative AI Professional
VICTOR MAESTRE RAMIREZ
 
Integration of Utility Data into 3D BIM Models Using a 3D Solids Modeling Wor...
Integration of Utility Data into 3D BIM Models Using a 3D Solids Modeling Wor...Integration of Utility Data into 3D BIM Models Using a 3D Solids Modeling Wor...
Integration of Utility Data into 3D BIM Models Using a 3D Solids Modeling Wor...
Safe Software
 
Dancing with AI - A Developer's Journey.pptx
Dancing with AI - A Developer's Journey.pptxDancing with AI - A Developer's Journey.pptx
Dancing with AI - A Developer's Journey.pptx
Elliott Richmond
 
Your startup on AWS - How to architect and maintain a Lean and Mean account
Your startup on AWS - How to architect and maintain a Lean and Mean accountYour startup on AWS - How to architect and maintain a Lean and Mean account
Your startup on AWS - How to architect and maintain a Lean and Mean account
angelo60207
 
Agentic AI: Beyond the Buzz- LangGraph Studio V2
Agentic AI: Beyond the Buzz- LangGraph Studio V2Agentic AI: Beyond the Buzz- LangGraph Studio V2
Agentic AI: Beyond the Buzz- LangGraph Studio V2
Shashikant Jagtap
 
TimeSeries Machine Learning - PyData London 2025
TimeSeries Machine Learning - PyData London 2025TimeSeries Machine Learning - PyData London 2025
TimeSeries Machine Learning - PyData London 2025
Suyash Joshi
 
Jeremy Millul - A Talented Software Developer
Jeremy Millul - A Talented Software DeveloperJeremy Millul - A Talented Software Developer
Jeremy Millul - A Talented Software Developer
Jeremy Millul
 
Introduction to Internet of things .ppt.
Introduction to Internet of things .ppt.Introduction to Internet of things .ppt.
Introduction to Internet of things .ppt.
hok12341073
 
If You Use Databricks, You Definitely Need FME
If You Use Databricks, You Definitely Need FMEIf You Use Databricks, You Definitely Need FME
If You Use Databricks, You Definitely Need FME
Safe Software
 
National Fuels Treatments Initiative: Building a Seamless Map of Hazardous Fu...
National Fuels Treatments Initiative: Building a Seamless Map of Hazardous Fu...National Fuels Treatments Initiative: Building a Seamless Map of Hazardous Fu...
National Fuels Treatments Initiative: Building a Seamless Map of Hazardous Fu...
Safe Software
 
What is Oracle EPM A Guide to Oracle EPM Cloud Everything You Need to Know
What is Oracle EPM A Guide to Oracle EPM Cloud Everything You Need to KnowWhat is Oracle EPM A Guide to Oracle EPM Cloud Everything You Need to Know
What is Oracle EPM A Guide to Oracle EPM Cloud Everything You Need to Know
SMACT Works
 
AI Agents in Logistics and Supply Chain Applications Benefits and Implementation
AI Agents in Logistics and Supply Chain Applications Benefits and ImplementationAI Agents in Logistics and Supply Chain Applications Benefits and Implementation
AI Agents in Logistics and Supply Chain Applications Benefits and Implementation
Christine Shepherd
 
TrustArc Webinar - 2025 Global Privacy Survey
TrustArc Webinar - 2025 Global Privacy SurveyTrustArc Webinar - 2025 Global Privacy Survey
TrustArc Webinar - 2025 Global Privacy Survey
TrustArc
 
Oracle Cloud Infrastructure AI Foundations
Oracle Cloud Infrastructure AI FoundationsOracle Cloud Infrastructure AI Foundations
Oracle Cloud Infrastructure AI Foundations
VICTOR MAESTRE RAMIREZ
 
Mastering AI Workflows with FME - Peak of Data & AI 2025
Mastering AI Workflows with FME - Peak of Data & AI 2025Mastering AI Workflows with FME - Peak of Data & AI 2025
Mastering AI Workflows with FME - Peak of Data & AI 2025
Safe Software
 
7 Salesforce Data Cloud Best Practices.pdf
7 Salesforce Data Cloud Best Practices.pdf7 Salesforce Data Cloud Best Practices.pdf
7 Salesforce Data Cloud Best Practices.pdf
Minuscule Technologies
 
Domino IQ – What to Expect, First Steps and Use Cases
Domino IQ – What to Expect, First Steps and Use CasesDomino IQ – What to Expect, First Steps and Use Cases
Domino IQ – What to Expect, First Steps and Use Cases
panagenda
 
DevOps in the Modern Era - Thoughtfully Critical Podcast
DevOps in the Modern Era - Thoughtfully Critical PodcastDevOps in the Modern Era - Thoughtfully Critical Podcast
DevOps in the Modern Era - Thoughtfully Critical Podcast
Chris Wahl
 
Soulmaite review - Find Real AI soulmate review
Soulmaite review - Find Real AI soulmate reviewSoulmaite review - Find Real AI soulmate review
Soulmaite review - Find Real AI soulmate review
Soulmaite
 
ISOIEC 42005 Revolutionalises AI Impact Assessment.pptx
ISOIEC 42005 Revolutionalises AI Impact Assessment.pptxISOIEC 42005 Revolutionalises AI Impact Assessment.pptx
ISOIEC 42005 Revolutionalises AI Impact Assessment.pptx
AyilurRamnath1
 
Oracle Cloud Infrastructure Generative AI Professional
Oracle Cloud Infrastructure Generative AI ProfessionalOracle Cloud Infrastructure Generative AI Professional
Oracle Cloud Infrastructure Generative AI Professional
VICTOR MAESTRE RAMIREZ
 
Integration of Utility Data into 3D BIM Models Using a 3D Solids Modeling Wor...
Integration of Utility Data into 3D BIM Models Using a 3D Solids Modeling Wor...Integration of Utility Data into 3D BIM Models Using a 3D Solids Modeling Wor...
Integration of Utility Data into 3D BIM Models Using a 3D Solids Modeling Wor...
Safe Software
 
Dancing with AI - A Developer's Journey.pptx
Dancing with AI - A Developer's Journey.pptxDancing with AI - A Developer's Journey.pptx
Dancing with AI - A Developer's Journey.pptx
Elliott Richmond
 
Your startup on AWS - How to architect and maintain a Lean and Mean account
Your startup on AWS - How to architect and maintain a Lean and Mean accountYour startup on AWS - How to architect and maintain a Lean and Mean account
Your startup on AWS - How to architect and maintain a Lean and Mean account
angelo60207
 
Agentic AI: Beyond the Buzz- LangGraph Studio V2
Agentic AI: Beyond the Buzz- LangGraph Studio V2Agentic AI: Beyond the Buzz- LangGraph Studio V2
Agentic AI: Beyond the Buzz- LangGraph Studio V2
Shashikant Jagtap
 
TimeSeries Machine Learning - PyData London 2025
TimeSeries Machine Learning - PyData London 2025TimeSeries Machine Learning - PyData London 2025
TimeSeries Machine Learning - PyData London 2025
Suyash Joshi
 
Jeremy Millul - A Talented Software Developer
Jeremy Millul - A Talented Software DeveloperJeremy Millul - A Talented Software Developer
Jeremy Millul - A Talented Software Developer
Jeremy Millul
 
Introduction to Internet of things .ppt.
Introduction to Internet of things .ppt.Introduction to Internet of things .ppt.
Introduction to Internet of things .ppt.
hok12341073
 
If You Use Databricks, You Definitely Need FME
If You Use Databricks, You Definitely Need FMEIf You Use Databricks, You Definitely Need FME
If You Use Databricks, You Definitely Need FME
Safe Software
 
National Fuels Treatments Initiative: Building a Seamless Map of Hazardous Fu...
National Fuels Treatments Initiative: Building a Seamless Map of Hazardous Fu...National Fuels Treatments Initiative: Building a Seamless Map of Hazardous Fu...
National Fuels Treatments Initiative: Building a Seamless Map of Hazardous Fu...
Safe Software
 
What is Oracle EPM A Guide to Oracle EPM Cloud Everything You Need to Know
What is Oracle EPM A Guide to Oracle EPM Cloud Everything You Need to KnowWhat is Oracle EPM A Guide to Oracle EPM Cloud Everything You Need to Know
What is Oracle EPM A Guide to Oracle EPM Cloud Everything You Need to Know
SMACT Works
 
AI Agents in Logistics and Supply Chain Applications Benefits and Implementation
AI Agents in Logistics and Supply Chain Applications Benefits and ImplementationAI Agents in Logistics and Supply Chain Applications Benefits and Implementation
AI Agents in Logistics and Supply Chain Applications Benefits and Implementation
Christine Shepherd
 
TrustArc Webinar - 2025 Global Privacy Survey
TrustArc Webinar - 2025 Global Privacy SurveyTrustArc Webinar - 2025 Global Privacy Survey
TrustArc Webinar - 2025 Global Privacy Survey
TrustArc
 
Oracle Cloud Infrastructure AI Foundations
Oracle Cloud Infrastructure AI FoundationsOracle Cloud Infrastructure AI Foundations
Oracle Cloud Infrastructure AI Foundations
VICTOR MAESTRE RAMIREZ
 

Java is an Object-Oriented Language

  • 1. Java is an Object-Oriented Language In structured programming languages, methods define the structure of the programs, they are basic building blocks Data has secondary role, it is just something that is passed around. In object oriented languages, the data has the principal role Methods belong to the data, without the data, the method does not have any meaning (Except static methods) Data and methods together make up the object. OOP tries to model the real world. What does the real world look like?
  • 2. Objects everywhere... Real world entities
  • 3. World The world is a set of things interacting with each other. OOP is more natural to humans, but less natural to computers Computers (usually) have a single thread of control, so objects take turns
  • 4. Describing the world Describe a particular person Ayse has long blond hair, green eyes, is 1.63m tall, weighs 56Kg and studies computer engineering. Now lying down asleep. Mehmet studies electronics, has short black hair and brown eyes. He is 180cm and 75 kilos. Now running to class! Notice how all have specific values of name, height, weight, eye colour, state, …
  • 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. Object Properties Identity State Behavior myLamp on off Object is an abstraction of a real world entity
  • 9. Introduction to Objects An object represents something with which we can interact in a program An object provides a collection of services that we can tell it to perform for us The services are defined by methods in a class that defines the object A class represents a concept, and an object represents the embodiment of a class A class can be used to create multiple objects
  • 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. Java OOP terminology Class - Category Properties/states Functionality/Services (examines/alters state) data methods object - Individual/unique thing (an instance of a class) Particular value for each property/state & functionality of all members of class.
  • 12. Java OOP Software Software System Set of objects Which interact with each other 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
  • 13. Abstraction An abstraction hides (or ignores) unnecessary details denotes the essential properties of an object One of the fundamental ways in which we handle complexity Objects are abstractions of real world entities Programming goal: choose the right abstractions Abstraction A car consists of four wheels an engine, accumulator and brakes.
  • 14. Multiple Abstractions A single thing can have multiple abstractions Example: a protein is… a sequence of amino acids a complicated 3D shape (a fold) a surface with “pockets” for ligands
  • 15. Choosing Abstractions Abstractions can be about tangible things (a vehicle, a car, a map) or intangible things (a meeting, a route, a schedule) An example: Abstraction name: light Light’s wattage (i.e.,energy usage) Light can be on or off There are other possible properties (shape, color, socket size, etc.), but we have decided those are less essential The essential properties are determined by the problem
  • 16. Object-Oriented Model methods data Object boundary
  • 17. Example: Pencil location direction penDown home up down write
  • 18. Encapsulation the data belonging to an object is hidden, so variables are private methods are public we use the public methods to change or access the private data No dependence on implementation location direction penDown home up down write public private
  • 19. Programming Implications Encapsulation makes programming easier As long as the contract is the same, the client doesn’t care about the implementation In Java, as long as the method signatures are the same, the implementation details can be changed In other words, I can write my program using simple implementations; then, if necessary, I can replace some of the simple implementations with efficient implementations
  • 21. Defining class Car What are the common attributes of cars? What are the common behaviors of cars?
  • 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. Java Syntax public class Car { // attribute declarations private String color; private int speed; private int power; // method declarations public void drive() { // …. } public void turnRight() { // …. } public void turnLeft() { // …. } public void stop() { // …. } } Car String color int speed int power drive() turnRight() turnLeft() stop()
  • 25. Class Pencil Pencil int location String direction home() up() down() write() attributes methods Name
  • 26. Declaring objects A class can be used to create objects Objects are the instances of that class Car String color int speed int power drive() turnRight() turnLeft() stop() new
  • 27. Java's "Building Blocks" Data types primitive constructs (e.g., integers, floating point numbers, characters) Class A description of a set of objects used to create objects
  • 28. Primitive Data There are exactly eight primitive data types in Java Four of them represent integers: byte , short , int , long Two of them represent floating point numbers: float , double One of them represents characters: char And one of them represents boolean values: boolean
  • 29. Declaring object variables A class name can be used as a type to declare an object reference variable Person ayse; An object reference variable holds the address of an object
  • 30. Declaring Objects Class Person ayse; Person String name String birthDate int age getName() getAge … . ayse is of Class
  • 31. Creating Objects We use the new operator to create an object ayse = new Person(); Creating an object is called instantiation An object is an instance of a particular class We can combine declaration and creation: ayse Class Object instance of refers to Person ayse = new Person(); is of Class Person String name String birthDate int age getName() getAge … .
  • 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. Basic approach Define class Declare objects Create objects Use objects
  • 34. Using objects The way you work with objects is to send them messages Most statements using objects have the following structure object.method for example: thisPerson.setAge(24); This means the object whose name is thisPerson is sent the message setAge() along with the "value" 24 The effect of this is to set the person's age to be 24 years old
  • 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