SlideShare a Scribd company logo
Theandroid-mania.com
Introduction
 Real-world objects share two characteristics: They all
have state and behavior. Dogs have state
(name, color, breed, hungry) and behavior
(barking, fetching, wagging tail). Bicycles also have state
(current gear, current pedal cadence, current speed) and
behavior (changing gear, changing pedal cadence, applying
brakes). Identifying the state and behavior for real-world
objects is a great way to begin thinking in terms of object-
oriented programming.
Theandroid-mania.com
OOP concept
 Software objects are conceptually similar to real-world
objects: they too consist of state and related behavior. An
object stores its state in fields(variables in some
programming languages) and exposes its behavior
through methods (functions in some programming
languages). Methods operate on an object's internal state
and serve as the primary mechanism for object-to-object
communication. Hiding internal state and requiring all
interaction to be performed through an object's methods
is known as data encapsulation — a fundamental
principle of object-oriented programming.
Theandroid-mania.com
Benefits of OOP programming
 Bundling code into individual software objects provides
a number of benefits, including:
 Modularity: The source code for an object can be written
and maintained independently of the source code for
other objects. Once created, an object can be easily
passed around inside the system.
 Information-hiding: By interacting only with an object's
methods, the details of its internal implementation
remain hidden from the outside world.
Theandroid-mania.com
 Code re-use: If an object already exists (perhaps written
by another software developer), you can use that object
in your program. This allows specialists to
implement/test/debug complex, task-specific
objects, which you can then trust to run in your own
code.
 Pluggability and debugging ease: If a particular object
turns out to be problematic, you can simply remove it
from your application and plug in a different object as its
replacement. This is analogous to fixing mechanical
problems in the real world. If a bolt breaks, you
replace it, not the entire machine.
Theandroid-mania.com
What Is Inheritance?
 Different kinds of objects often have a certain amount in common
with each other. Mountain bikes, road bikes, and tandem bikes, for
example, all share the characteristics of bicycles (current
speed, current pedal cadence, current gear). Yet each also defines
additional features that make them different: tandem bicycles have
two seats and two sets of handlebars; road bikes have drop
handlebars; some mountain bikes have an additional chain
ring, giving them a lower gear ratio.
 Object-oriented programming allows classes to inherit commonly
used state and behavior from other classes. In this
example, Bicycle now becomes
the superclass of MountainBike, RoadBike, and TandemBike. In the
Java programming language, each class is allowed to have one direct
superclass, and each superclass has the potential for an unlimited
number of subclasses:
Theandroid-mania.com

More Related Content

Similar to Object Oriented Programing and JAVA

Java Programming Paradigms Chapter 1
Java Programming Paradigms Chapter 1 Java Programming Paradigms Chapter 1
Java Programming Paradigms Chapter 1
Sakthi Durai
 
COMP111-Week-1_138439.pptx
COMP111-Week-1_138439.pptxCOMP111-Week-1_138439.pptx
COMP111-Week-1_138439.pptx
FarooqTariq8
 
Unit1 jaava
Unit1 jaavaUnit1 jaava
Unit1 jaavamrecedu
 
Java chapter 3 - OOPs concepts
Java chapter 3 - OOPs conceptsJava chapter 3 - OOPs concepts
Java chapter 3 - OOPs concepts
Mukesh Tekwani
 
Intro to BackboneJS + Intermediate Javascript
Intro to BackboneJS + Intermediate JavascriptIntro to BackboneJS + Intermediate Javascript
Intro to BackboneJS + Intermediate JavascriptAndrew Lovett-Barron
 
03. oop concepts
03. oop concepts03. oop concepts
03. oop concepts
Haresh Jaiswal
 
Object-Oriented Concepts
Object-Oriented ConceptsObject-Oriented Concepts
Object-Oriented ConceptsAbdalla Mahmoud
 
Object-Oriented Programming Concepts
Object-Oriented Programming ConceptsObject-Oriented Programming Concepts
Object-Oriented Programming Concepts
Kwangshin Oh
 
Cs2305 programming paradigms lecturer notes
Cs2305   programming paradigms lecturer notesCs2305   programming paradigms lecturer notes
Cs2305 programming paradigms lecturer notes
Saravanakumar viswanathan
 
Object-oriented modeling and design.pdf
Object-oriented modeling and  design.pdfObject-oriented modeling and  design.pdf
Object-oriented modeling and design.pdf
SHIVAM691605
 
Cs 2352 object oriented analysis and design
Cs 2352 object oriented analysis and designCs 2352 object oriented analysis and design
Cs 2352 object oriented analysis and design
andrewsasi
 
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
 
What is Object Orientation?
What is Object Orientation?What is Object Orientation?
What is Object Orientation?
AMITJain879
 
What I Learned At Drupal Con Dc 2009
What I Learned At Drupal Con Dc 2009What I Learned At Drupal Con Dc 2009
What I Learned At Drupal Con Dc 2009
Neil Giarratana
 
C++ notes.pdf
C++ notes.pdfC++ notes.pdf
C++ notes.pdf
RajanBagale3
 
Lecture1 cst205 cst281-oop
Lecture1 cst205 cst281-oopLecture1 cst205 cst281-oop
Lecture1 cst205 cst281-oop
ktuonlinenotes
 
OOP programming
OOP programmingOOP programming
OOP programminganhdbh
 
Java Programming.pdf
Java Programming.pdfJava Programming.pdf
Java Programming.pdf
IthagoniShirisha
 
Cis 555 Week 4 Assignment 2 Automated Teller Machine (Atm)...
Cis 555 Week 4 Assignment 2 Automated Teller Machine (Atm)...Cis 555 Week 4 Assignment 2 Automated Teller Machine (Atm)...
Cis 555 Week 4 Assignment 2 Automated Teller Machine (Atm)...
Karen Thompson
 

Similar to Object Oriented Programing and JAVA (20)

Java Programming Paradigms Chapter 1
Java Programming Paradigms Chapter 1 Java Programming Paradigms Chapter 1
Java Programming Paradigms Chapter 1
 
COMP111-Week-1_138439.pptx
COMP111-Week-1_138439.pptxCOMP111-Week-1_138439.pptx
COMP111-Week-1_138439.pptx
 
Unit1 jaava
Unit1 jaavaUnit1 jaava
Unit1 jaava
 
Java chapter 3 - OOPs concepts
Java chapter 3 - OOPs conceptsJava chapter 3 - OOPs concepts
Java chapter 3 - OOPs concepts
 
Intro to BackboneJS + Intermediate Javascript
Intro to BackboneJS + Intermediate JavascriptIntro to BackboneJS + Intermediate Javascript
Intro to BackboneJS + Intermediate Javascript
 
03. oop concepts
03. oop concepts03. oop concepts
03. oop concepts
 
Object-Oriented Concepts
Object-Oriented ConceptsObject-Oriented Concepts
Object-Oriented Concepts
 
Object-Oriented Programming Concepts
Object-Oriented Programming ConceptsObject-Oriented Programming Concepts
Object-Oriented Programming Concepts
 
Cs2305 programming paradigms lecturer notes
Cs2305   programming paradigms lecturer notesCs2305   programming paradigms lecturer notes
Cs2305 programming paradigms lecturer notes
 
Object-oriented modeling and design.pdf
Object-oriented modeling and  design.pdfObject-oriented modeling and  design.pdf
Object-oriented modeling and design.pdf
 
Cs 2352 object oriented analysis and design
Cs 2352 object oriented analysis and designCs 2352 object oriented analysis and design
Cs 2352 object oriented analysis and design
 
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
 
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
 
What is Object Orientation?
What is Object Orientation?What is Object Orientation?
What is Object Orientation?
 
What I Learned At Drupal Con Dc 2009
What I Learned At Drupal Con Dc 2009What I Learned At Drupal Con Dc 2009
What I Learned At Drupal Con Dc 2009
 
C++ notes.pdf
C++ notes.pdfC++ notes.pdf
C++ notes.pdf
 
Lecture1 cst205 cst281-oop
Lecture1 cst205 cst281-oopLecture1 cst205 cst281-oop
Lecture1 cst205 cst281-oop
 
OOP programming
OOP programmingOOP programming
OOP programming
 
Java Programming.pdf
Java Programming.pdfJava Programming.pdf
Java Programming.pdf
 
Cis 555 Week 4 Assignment 2 Automated Teller Machine (Atm)...
Cis 555 Week 4 Assignment 2 Automated Teller Machine (Atm)...Cis 555 Week 4 Assignment 2 Automated Teller Machine (Atm)...
Cis 555 Week 4 Assignment 2 Automated Teller Machine (Atm)...
 

More from Gujarat Technological University

XML - The Extensible Markup Language
XML - The Extensible Markup LanguageXML - The Extensible Markup Language
XML - The Extensible Markup Language
Gujarat Technological University
 
Data types ,variables,array
Data types ,variables,arrayData types ,variables,array
Data types ,variables,array
Gujarat Technological University
 
Creating classes and applications in java
Creating classes and applications in javaCreating classes and applications in java
Creating classes and applications in java
Gujarat Technological University
 

More from Gujarat Technological University (6)

Readme
ReadmeReadme
Readme
 
Ppt ppb module a
Ppt ppb   module aPpt ppb   module a
Ppt ppb module a
 
XML - The Extensible Markup Language
XML - The Extensible Markup LanguageXML - The Extensible Markup Language
XML - The Extensible Markup Language
 
Data types ,variables,array
Data types ,variables,arrayData types ,variables,array
Data types ,variables,array
 
Creating classes and applications in java
Creating classes and applications in javaCreating classes and applications in java
Creating classes and applications in java
 
Collections
CollectionsCollections
Collections
 

Recently uploaded

Pride Month Slides 2024 David Douglas School District
Pride Month Slides 2024 David Douglas School DistrictPride Month Slides 2024 David Douglas School District
Pride Month Slides 2024 David Douglas School District
David Douglas School District
 
Digital Artefact 1 - Tiny Home Environmental Design
Digital Artefact 1 - Tiny Home Environmental DesignDigital Artefact 1 - Tiny Home Environmental Design
Digital Artefact 1 - Tiny Home Environmental Design
amberjdewit93
 
South African Journal of Science: Writing with integrity workshop (2024)
South African Journal of Science: Writing with integrity workshop (2024)South African Journal of Science: Writing with integrity workshop (2024)
South African Journal of Science: Writing with integrity workshop (2024)
Academy of Science of South Africa
 
The Challenger.pdf DNHS Official Publication
The Challenger.pdf DNHS Official PublicationThe Challenger.pdf DNHS Official Publication
The Challenger.pdf DNHS Official Publication
Delapenabediema
 
Thesis Statement for students diagnonsed withADHD.ppt
Thesis Statement for students diagnonsed withADHD.pptThesis Statement for students diagnonsed withADHD.ppt
Thesis Statement for students diagnonsed withADHD.ppt
EverAndrsGuerraGuerr
 
Top five deadliest dog breeds in America
Top five deadliest dog breeds in AmericaTop five deadliest dog breeds in America
Top five deadliest dog breeds in America
Bisnar Chase Personal Injury Attorneys
 
Exploiting Artificial Intelligence for Empowering Researchers and Faculty, In...
Exploiting Artificial Intelligence for Empowering Researchers and Faculty, In...Exploiting Artificial Intelligence for Empowering Researchers and Faculty, In...
Exploiting Artificial Intelligence for Empowering Researchers and Faculty, In...
Dr. Vinod Kumar Kanvaria
 
Biological Screening of Herbal Drugs in detailed.
Biological Screening of Herbal Drugs in detailed.Biological Screening of Herbal Drugs in detailed.
Biological Screening of Herbal Drugs in detailed.
Ashokrao Mane college of Pharmacy Peth-Vadgaon
 
S1-Introduction-Biopesticides in ICM.pptx
S1-Introduction-Biopesticides in ICM.pptxS1-Introduction-Biopesticides in ICM.pptx
S1-Introduction-Biopesticides in ICM.pptx
tarandeep35
 
World environment day ppt For 5 June 2024
World environment day ppt For 5 June 2024World environment day ppt For 5 June 2024
World environment day ppt For 5 June 2024
ak6969907
 
Lapbook sobre os Regimes Totalitários.pdf
Lapbook sobre os Regimes Totalitários.pdfLapbook sobre os Regimes Totalitários.pdf
Lapbook sobre os Regimes Totalitários.pdf
Jean Carlos Nunes Paixão
 
Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46
Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46
Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46
MysoreMuleSoftMeetup
 
ANATOMY AND BIOMECHANICS OF HIP JOINT.pdf
ANATOMY AND BIOMECHANICS OF HIP JOINT.pdfANATOMY AND BIOMECHANICS OF HIP JOINT.pdf
ANATOMY AND BIOMECHANICS OF HIP JOINT.pdf
Priyankaranawat4
 
MASS MEDIA STUDIES-835-CLASS XI Resource Material.pdf
MASS MEDIA STUDIES-835-CLASS XI Resource Material.pdfMASS MEDIA STUDIES-835-CLASS XI Resource Material.pdf
MASS MEDIA STUDIES-835-CLASS XI Resource Material.pdf
goswamiyash170123
 
June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...
June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...
June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...
Levi Shapiro
 
DRUGS AND ITS classification slide share
DRUGS AND ITS classification slide shareDRUGS AND ITS classification slide share
DRUGS AND ITS classification slide share
taiba qazi
 
Chapter 4 - Islamic Financial Institutions in Malaysia.pptx
Chapter 4 - Islamic Financial Institutions in Malaysia.pptxChapter 4 - Islamic Financial Institutions in Malaysia.pptx
Chapter 4 - Islamic Financial Institutions in Malaysia.pptx
Mohd Adib Abd Muin, Senior Lecturer at Universiti Utara Malaysia
 
A Strategic Approach: GenAI in Education
A Strategic Approach: GenAI in EducationA Strategic Approach: GenAI in Education
A Strategic Approach: GenAI in Education
Peter Windle
 
Introduction to AI for Nonprofits with Tapp Network
Introduction to AI for Nonprofits with Tapp NetworkIntroduction to AI for Nonprofits with Tapp Network
Introduction to AI for Nonprofits with Tapp Network
TechSoup
 
Azure Interview Questions and Answers PDF By ScholarHat
Azure Interview Questions and Answers PDF By ScholarHatAzure Interview Questions and Answers PDF By ScholarHat
Azure Interview Questions and Answers PDF By ScholarHat
Scholarhat
 

Recently uploaded (20)

Pride Month Slides 2024 David Douglas School District
Pride Month Slides 2024 David Douglas School DistrictPride Month Slides 2024 David Douglas School District
Pride Month Slides 2024 David Douglas School District
 
Digital Artefact 1 - Tiny Home Environmental Design
Digital Artefact 1 - Tiny Home Environmental DesignDigital Artefact 1 - Tiny Home Environmental Design
Digital Artefact 1 - Tiny Home Environmental Design
 
South African Journal of Science: Writing with integrity workshop (2024)
South African Journal of Science: Writing with integrity workshop (2024)South African Journal of Science: Writing with integrity workshop (2024)
South African Journal of Science: Writing with integrity workshop (2024)
 
The Challenger.pdf DNHS Official Publication
The Challenger.pdf DNHS Official PublicationThe Challenger.pdf DNHS Official Publication
The Challenger.pdf DNHS Official Publication
 
Thesis Statement for students diagnonsed withADHD.ppt
Thesis Statement for students diagnonsed withADHD.pptThesis Statement for students diagnonsed withADHD.ppt
Thesis Statement for students diagnonsed withADHD.ppt
 
Top five deadliest dog breeds in America
Top five deadliest dog breeds in AmericaTop five deadliest dog breeds in America
Top five deadliest dog breeds in America
 
Exploiting Artificial Intelligence for Empowering Researchers and Faculty, In...
Exploiting Artificial Intelligence for Empowering Researchers and Faculty, In...Exploiting Artificial Intelligence for Empowering Researchers and Faculty, In...
Exploiting Artificial Intelligence for Empowering Researchers and Faculty, In...
 
Biological Screening of Herbal Drugs in detailed.
Biological Screening of Herbal Drugs in detailed.Biological Screening of Herbal Drugs in detailed.
Biological Screening of Herbal Drugs in detailed.
 
S1-Introduction-Biopesticides in ICM.pptx
S1-Introduction-Biopesticides in ICM.pptxS1-Introduction-Biopesticides in ICM.pptx
S1-Introduction-Biopesticides in ICM.pptx
 
World environment day ppt For 5 June 2024
World environment day ppt For 5 June 2024World environment day ppt For 5 June 2024
World environment day ppt For 5 June 2024
 
Lapbook sobre os Regimes Totalitários.pdf
Lapbook sobre os Regimes Totalitários.pdfLapbook sobre os Regimes Totalitários.pdf
Lapbook sobre os Regimes Totalitários.pdf
 
Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46
Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46
Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46
 
ANATOMY AND BIOMECHANICS OF HIP JOINT.pdf
ANATOMY AND BIOMECHANICS OF HIP JOINT.pdfANATOMY AND BIOMECHANICS OF HIP JOINT.pdf
ANATOMY AND BIOMECHANICS OF HIP JOINT.pdf
 
MASS MEDIA STUDIES-835-CLASS XI Resource Material.pdf
MASS MEDIA STUDIES-835-CLASS XI Resource Material.pdfMASS MEDIA STUDIES-835-CLASS XI Resource Material.pdf
MASS MEDIA STUDIES-835-CLASS XI Resource Material.pdf
 
June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...
June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...
June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...
 
DRUGS AND ITS classification slide share
DRUGS AND ITS classification slide shareDRUGS AND ITS classification slide share
DRUGS AND ITS classification slide share
 
Chapter 4 - Islamic Financial Institutions in Malaysia.pptx
Chapter 4 - Islamic Financial Institutions in Malaysia.pptxChapter 4 - Islamic Financial Institutions in Malaysia.pptx
Chapter 4 - Islamic Financial Institutions in Malaysia.pptx
 
A Strategic Approach: GenAI in Education
A Strategic Approach: GenAI in EducationA Strategic Approach: GenAI in Education
A Strategic Approach: GenAI in Education
 
Introduction to AI for Nonprofits with Tapp Network
Introduction to AI for Nonprofits with Tapp NetworkIntroduction to AI for Nonprofits with Tapp Network
Introduction to AI for Nonprofits with Tapp Network
 
Azure Interview Questions and Answers PDF By ScholarHat
Azure Interview Questions and Answers PDF By ScholarHatAzure Interview Questions and Answers PDF By ScholarHat
Azure Interview Questions and Answers PDF By ScholarHat
 

Object Oriented Programing and JAVA

  • 2. Introduction  Real-world objects share two characteristics: They all have state and behavior. Dogs have state (name, color, breed, hungry) and behavior (barking, fetching, wagging tail). Bicycles also have state (current gear, current pedal cadence, current speed) and behavior (changing gear, changing pedal cadence, applying brakes). Identifying the state and behavior for real-world objects is a great way to begin thinking in terms of object- oriented programming. Theandroid-mania.com
  • 3. OOP concept  Software objects are conceptually similar to real-world objects: they too consist of state and related behavior. An object stores its state in fields(variables in some programming languages) and exposes its behavior through methods (functions in some programming languages). Methods operate on an object's internal state and serve as the primary mechanism for object-to-object communication. Hiding internal state and requiring all interaction to be performed through an object's methods is known as data encapsulation — a fundamental principle of object-oriented programming. Theandroid-mania.com
  • 4. Benefits of OOP programming  Bundling code into individual software objects provides a number of benefits, including:  Modularity: The source code for an object can be written and maintained independently of the source code for other objects. Once created, an object can be easily passed around inside the system.  Information-hiding: By interacting only with an object's methods, the details of its internal implementation remain hidden from the outside world. Theandroid-mania.com
  • 5.  Code re-use: If an object already exists (perhaps written by another software developer), you can use that object in your program. This allows specialists to implement/test/debug complex, task-specific objects, which you can then trust to run in your own code.  Pluggability and debugging ease: If a particular object turns out to be problematic, you can simply remove it from your application and plug in a different object as its replacement. This is analogous to fixing mechanical problems in the real world. If a bolt breaks, you replace it, not the entire machine. Theandroid-mania.com
  • 6. What Is Inheritance?  Different kinds of objects often have a certain amount in common with each other. Mountain bikes, road bikes, and tandem bikes, for example, all share the characteristics of bicycles (current speed, current pedal cadence, current gear). Yet each also defines additional features that make them different: tandem bicycles have two seats and two sets of handlebars; road bikes have drop handlebars; some mountain bikes have an additional chain ring, giving them a lower gear ratio.  Object-oriented programming allows classes to inherit commonly used state and behavior from other classes. In this example, Bicycle now becomes the superclass of MountainBike, RoadBike, and TandemBike. In the Java programming language, each class is allowed to have one direct superclass, and each superclass has the potential for an unlimited number of subclasses: Theandroid-mania.com