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

PPTX
2 oop
PPTX
Introduction to Object Oriented Concepts
PDF
Introduction to Object Oriented Concepts
PDF
What's New in NetBeans IDE 7.x
PPTX
Introduction to java
DOC
Java getstarted
PDF
1-oop java-object
PDF
Java Programming Paradigms Chapter 1
2 oop
Introduction to Object Oriented Concepts
Introduction to Object Oriented Concepts
What's New in NetBeans IDE 7.x
Introduction to java
Java getstarted
1-oop java-object
Java Programming Paradigms Chapter 1

Similar to Object Oriented Programing and JAVA (20)

PDF
Java Progamming Paradigms, OOPS Concept, Introduction to Java, Structure of J...
PPTX
COMP111-Week-1_138439.pptx
DOCX
Unit1 jaava
PDF
Java chapter 3 - OOPs concepts
PDF
Intro to BackboneJS + Intermediate Javascript
PPTX
bbbnnjxhxshjsjskshsjsjshssddhjddjdjddhgd
PDF
03. oop concepts
PPT
Object-Oriented Concepts
PPT
Object-Oriented Programming Concepts
PDF
Cs2305 programming paradigms lecturer notes
PDF
Object-oriented modeling and design.pdf
PDF
Cs 2352 object oriented analysis and design
DOCX
Class notes(week 2) on basic concepts of oop-2
PDF
Class notes(week 2) on basic concepts of oop-2
PPTX
What is Object Orientation?
PDF
What I Learned At Drupal Con Dc 2009
PDF
C++ notes.pdf
PDF
Lecture1 cst205 cst281-oop
PPT
OOP programming
PDF
Java Programming.pdf
Java Progamming Paradigms, OOPS Concept, Introduction to Java, Structure of J...
COMP111-Week-1_138439.pptx
Unit1 jaava
Java chapter 3 - OOPs concepts
Intro to BackboneJS + Intermediate Javascript
bbbnnjxhxshjsjskshsjsjshssddhjddjdjddhgd
03. oop concepts
Object-Oriented Concepts
Object-Oriented Programming Concepts
Cs2305 programming paradigms lecturer notes
Object-oriented modeling and design.pdf
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-2
What is Object Orientation?
What I Learned At Drupal Con Dc 2009
C++ notes.pdf
Lecture1 cst205 cst281-oop
OOP programming
Java Programming.pdf
Ad

More from Gujarat Technological University (6)

PPSX
PPS
XML - The Extensible Markup Language
PPS
Data types ,variables,array
PPS
Creating classes and applications in java
XML - The Extensible Markup Language
Data types ,variables,array
Creating classes and applications in java
Ad

Recently uploaded (20)

PPTX
Microbial diseases, their pathogenesis and prophylaxis
PDF
Chapter 2 Heredity, Prenatal Development, and Birth.pdf
PPTX
Final Presentation General Medicine 03-08-2024.pptx
PDF
VCE English Exam - Section C Student Revision Booklet
PPTX
1st Inaugural Professorial Lecture held on 19th February 2020 (Governance and...
PDF
FourierSeries-QuestionsWithAnswers(Part-A).pdf
PPTX
school management -TNTEU- B.Ed., Semester II Unit 1.pptx
PDF
01-Introduction-to-Information-Management.pdf
PDF
Complications of Minimal Access Surgery at WLH
PDF
A GUIDE TO GENETICS FOR UNDERGRADUATE MEDICAL STUDENTS
PPTX
Introduction-to-Literarature-and-Literary-Studies-week-Prelim-coverage.pptx
PDF
grade 11-chemistry_fetena_net_5883.pdf teacher guide for all student
PDF
The Lost Whites of Pakistan by Jahanzaib Mughal.pdf
PPTX
human mycosis Human fungal infections are called human mycosis..pptx
PDF
RMMM.pdf make it easy to upload and study
PPTX
IMMUNITY IMMUNITY refers to protection against infection, and the immune syst...
PPTX
Lesson notes of climatology university.
PDF
Module 4: Burden of Disease Tutorial Slides S2 2025
PPTX
Presentation on HIE in infants and its manifestations
PDF
ANTIBIOTICS.pptx.pdf………………… xxxxxxxxxxxxx
Microbial diseases, their pathogenesis and prophylaxis
Chapter 2 Heredity, Prenatal Development, and Birth.pdf
Final Presentation General Medicine 03-08-2024.pptx
VCE English Exam - Section C Student Revision Booklet
1st Inaugural Professorial Lecture held on 19th February 2020 (Governance and...
FourierSeries-QuestionsWithAnswers(Part-A).pdf
school management -TNTEU- B.Ed., Semester II Unit 1.pptx
01-Introduction-to-Information-Management.pdf
Complications of Minimal Access Surgery at WLH
A GUIDE TO GENETICS FOR UNDERGRADUATE MEDICAL STUDENTS
Introduction-to-Literarature-and-Literary-Studies-week-Prelim-coverage.pptx
grade 11-chemistry_fetena_net_5883.pdf teacher guide for all student
The Lost Whites of Pakistan by Jahanzaib Mughal.pdf
human mycosis Human fungal infections are called human mycosis..pptx
RMMM.pdf make it easy to upload and study
IMMUNITY IMMUNITY refers to protection against infection, and the immune syst...
Lesson notes of climatology university.
Module 4: Burden of Disease Tutorial Slides S2 2025
Presentation on HIE in infants and its manifestations
ANTIBIOTICS.pptx.pdf………………… xxxxxxxxxxxxx

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