Java Object Oriented Programming
Java Object Oriented Programming
Java Object Oriented Programming
*
Object Oriented Programming is a paradigm that provides many
concepts such as inheritance, data binding, polymorphism etc.
*
It simplifies the software development and maintenance by providing
some concepts:
Object
Class
Inheritance
Polymorphism
Abstraction
Encapsulation
Any entity that has state and behavior is known as an object.
For example: chair, pen, table, keyboard, bike etc. It can be
physical and logical.
An object has three characteristics:
state: represents data (value) of an object.
behavior: represents the behavior (functionality) of an object
such as deposit, withdraw etc.
identity: Object identity is typically implemented via a
unique ID. The value of the ID is not visible to the external
user. But, it is used internally by the JVM to identify each
object uniquely.
*
Collection of objects is called class. It is a logical entity.
A class is a group of objects that has common properties. It is a
template or blueprint from which objects are created. A class in
java can contain:
data member
method
constructor
block
class and interface
*
When one object acquires all the properties and
behaviors of parent object i.e. known as
inheritance. It provides code reusability. It is used
to achieve runtime polymorphism.
*
When one task is performed by different ways i.e.
known as polymorphism. For example: to convense the
customer differently, to draw something e.g. shape or
rectangle etc.
In java, we use method overloading and method
overriding to achieve polymorphism.
Another example can be to speak something e.g. cat
speaks meaw, dog barks woof etc.
*
Hiding internal details and showing functionality
is known as abstraction. For example: phone call,
we don't know the internal processing.
In java, we use abstract class and interface to
achieve abstraction.
*
Binding (or wrapping) code and data together into a
single unit is known as encapsulation. For example:
capsule, it is wrapped with different medicines.
A java class is the example of encapsulation. Java bean is
the fully encapsulated class because all the data members
are private here.
*
By using standard Java naming conventions, you make your
code easier to read for yourself and for other
programmers. Readability of Java program is very
important. It indicates that less time is spent to figure out
what the code does.
*
Java follows camelcase syntax for naming the class,
interface, method and variable.
If name is combined with two words, second word will start
with uppercase letter always e.g. actionPerformed(),
firstName, ActionEvent, ActionListener etc.
*
*
If a class have multiple methods by same name but
different parameters, it is known as Method Overloading.
There are two ways to overload the method in java:
By changing number of arguments
By changing the data type
*
*
Constructor in java is a special type of method that is
used to initialize the object.
Rules for creating java constructor
There are basically two rules defined for the constructor.
Constructor name must be same as its class name
Constructor must have no explicit return type
*
Default constructor provides the default values to the
object like 0, null etc. depending on the type.
Java parameterized constructor
A constructor that have parameters is known as parameterized
constructor.
Why use parameterized constructor?
Parameterized constructor is used to provide different values to the
distinct objects.
*
There can be a lot of usage of java this keyword. In java,
this is a reference variable that refers to the current
object.
*
If subclass (child class) has the same method as declared in
the parent class, it is known as method o
Usage of Java Method Overriding
Method overriding is used to provide specific
implementation of a method that is already provided by its
super class.
Method overriding is used for runtime polymorphism
Rules for Java Method Overriding
method must have same name as in the parent class
method must have same parameter as in the parent class.
must be IS-A relationship (inheritance).

More Related Content

PPTX
Hibernate in Action
PPTX
Multiple inheritance in java3 (1).pptx
PPTX
Introduction to spring boot
PDF
Chapter 02: Classes Objects and Methods Java by Tushar B Kute
PDF
Arrays in Java
PPTX
React js
Hibernate in Action
Multiple inheritance in java3 (1).pptx
Introduction to spring boot
Chapter 02: Classes Objects and Methods Java by Tushar B Kute
Arrays in Java
React js

What's hot (20)

PPTX
Hibernate ppt
PPTX
Delegates and events in C#
PPTX
Training on Core java | PPT Presentation | Shravan Sanidhya
PDF
Spring Boot
PPTX
PDF
Java Tutorial For Beginners - Step By Step | Java Basics | Java Certification...
PPTX
Spring beans
PPTX
Spring boot Introduction
PPTX
Java script
PDF
Introduction to Java Programming
PDF
Spring boot jpa
PPTX
WHAT IS ABSTRACTION IN JAVA
PPTX
Applets in java
PPTX
Java constructors
PDF
REST API and CRUD
PDF
JavaScript - Chapter 6 - Basic Functions
PDF
JAVA PPT Part-1 BY ADI.pdf
PPT
Php Presentation
PDF
CSS Day: CSS Grid Layout
Hibernate ppt
Delegates and events in C#
Training on Core java | PPT Presentation | Shravan Sanidhya
Spring Boot
Java Tutorial For Beginners - Step By Step | Java Basics | Java Certification...
Spring beans
Spring boot Introduction
Java script
Introduction to Java Programming
Spring boot jpa
WHAT IS ABSTRACTION IN JAVA
Applets in java
Java constructors
REST API and CRUD
JavaScript - Chapter 6 - Basic Functions
JAVA PPT Part-1 BY ADI.pdf
Php Presentation
CSS Day: CSS Grid Layout
Ad

Viewers also liked (14)

PPTX
oops concept in java | object oriented programming in java
PPTX
Introduction to java
PDF
Object oriented programming
PPSX
Concept of Object Oriented Programming
PPTX
From Selling 2 Books a Day, To 200 - How I Did It? - J. Thorn
PPTX
Interesting Concept of Object Oriented Programming
PDF
It Is Possible to Do Object-Oriented Programming in Java
PPT
Java for C++ programers
PDF
String handling(string class)
PDF
Java Inheritance
PPTX
Basic Concepts of OOPs (Object Oriented Programming in Java)
PPT
Java: Inheritance
PPT
Object Oriented Programming with Java
PPT
Basic concepts of object oriented programming
oops concept in java | object oriented programming in java
Introduction to java
Object oriented programming
Concept of Object Oriented Programming
From Selling 2 Books a Day, To 200 - How I Did It? - J. Thorn
Interesting Concept of Object Oriented Programming
It Is Possible to Do Object-Oriented Programming in Java
Java for C++ programers
String handling(string class)
Java Inheritance
Basic Concepts of OOPs (Object Oriented Programming in Java)
Java: Inheritance
Object Oriented Programming with Java
Basic concepts of object oriented programming
Ad

Similar to Java Object Oriented Programming (20)

DOCX
javaopps concepts
DOCX
Computer Programming 2
PPTX
Nitish Chaulagai Java1.pptx
PPTX
Presentation2.ppt java basic core ppt .
PPTX
OCA Java SE 8 Exam Chapter 1 Java Building Blocks
PDF
Qb it1301
PDF
A seminar report on core java
PDF
Java Interview Questions
PPT
Md02 - Getting Started part-2
PPTX
Introduction to oop and java fundamentals
PPTX
Java_Interview Qns
PPT
JAVA_INTRODUCTION- History, Constructor, Inheritance
DOCX
Object Oriented Programming All Unit Notes
DOCX
Java OOPs Concepts.docx
DOCX
100 Java questions FOR LOGIC BUILDING SOFTWARE.docx
PPTX
PPTX
JavaScript OOPS Implimentation
PPTX
UNIT - 1 Java Fundamentals, Basics of java
PPTX
UNIT 3- Java- Inheritance, Multithreading.pptx
javaopps concepts
Computer Programming 2
Nitish Chaulagai Java1.pptx
Presentation2.ppt java basic core ppt .
OCA Java SE 8 Exam Chapter 1 Java Building Blocks
Qb it1301
A seminar report on core java
Java Interview Questions
Md02 - Getting Started part-2
Introduction to oop and java fundamentals
Java_Interview Qns
JAVA_INTRODUCTION- History, Constructor, Inheritance
Object Oriented Programming All Unit Notes
Java OOPs Concepts.docx
100 Java questions FOR LOGIC BUILDING SOFTWARE.docx
JavaScript OOPS Implimentation
UNIT - 1 Java Fundamentals, Basics of java
UNIT 3- Java- Inheritance, Multithreading.pptx

More from University of Potsdam (20)

PPTX
Computer fundamentals 01
PPTX
Workshop on android apps development
PDF
Transparency and concurrency
PDF
Database System Architecture
PDF
Functional dependency and normalization
PDF
indexing and hashing
PDF
data recovery-raid
PDF
Query processing
PDF
Machine Learning for Data Mining
PPTX
Tree, function and graph
PDF
Sets in discrete mathematics
PPT
Set in discrete mathematics
PPT
Series parallel ac rlc networks
PPT
Series parallel ac networks
PPT
PDF
PPT
Propositional logic
PDF
Propositional logic
PDF
Prim algorithm
Computer fundamentals 01
Workshop on android apps development
Transparency and concurrency
Database System Architecture
Functional dependency and normalization
indexing and hashing
data recovery-raid
Query processing
Machine Learning for Data Mining
Tree, function and graph
Sets in discrete mathematics
Set in discrete mathematics
Series parallel ac rlc networks
Series parallel ac networks
Propositional logic
Propositional logic
Prim algorithm

Recently uploaded (20)

PDF
David L Page_DCI Research Study Journey_how Methodology can inform one's prac...
PPTX
Share_Module_2_Power_conflict_and_negotiation.pptx
PDF
Vision Prelims GS PYQ Analysis 2011-2022 www.upscpdf.com.pdf
PPTX
What’s under the hood: Parsing standardized learning content for AI
PDF
LIFE & LIVING TRILOGY - PART (3) REALITY & MYSTERY.pdf
PDF
My India Quiz Book_20210205121199924.pdf
PPTX
A powerpoint presentation on the Revised K-10 Science Shaping Paper
PDF
Hazard Identification & Risk Assessment .pdf
PDF
Journal of Dental Science - UDMY (2021).pdf
PDF
Mucosal Drug Delivery system_NDDS_BPHARMACY__SEM VII_PCI.pdf
PPTX
Introduction to pro and eukaryotes and differences.pptx
PDF
MBA _Common_ 2nd year Syllabus _2021-22_.pdf
PDF
medical_surgical_nursing_10th_edition_ignatavicius_TEST_BANK_pdf.pdf
DOCX
Cambridge-Practice-Tests-for-IELTS-12.docx
PPTX
Core Concepts of Personalized Learning and Virtual Learning Environments
PPTX
Computer Architecture Input Output Memory.pptx
PDF
What if we spent less time fighting change, and more time building what’s rig...
PDF
HVAC Specification 2024 according to central public works department
PDF
semiconductor packaging in vlsi design fab
PPTX
Unit 4 Computer Architecture Multicore Processor.pptx
David L Page_DCI Research Study Journey_how Methodology can inform one's prac...
Share_Module_2_Power_conflict_and_negotiation.pptx
Vision Prelims GS PYQ Analysis 2011-2022 www.upscpdf.com.pdf
What’s under the hood: Parsing standardized learning content for AI
LIFE & LIVING TRILOGY - PART (3) REALITY & MYSTERY.pdf
My India Quiz Book_20210205121199924.pdf
A powerpoint presentation on the Revised K-10 Science Shaping Paper
Hazard Identification & Risk Assessment .pdf
Journal of Dental Science - UDMY (2021).pdf
Mucosal Drug Delivery system_NDDS_BPHARMACY__SEM VII_PCI.pdf
Introduction to pro and eukaryotes and differences.pptx
MBA _Common_ 2nd year Syllabus _2021-22_.pdf
medical_surgical_nursing_10th_edition_ignatavicius_TEST_BANK_pdf.pdf
Cambridge-Practice-Tests-for-IELTS-12.docx
Core Concepts of Personalized Learning and Virtual Learning Environments
Computer Architecture Input Output Memory.pptx
What if we spent less time fighting change, and more time building what’s rig...
HVAC Specification 2024 according to central public works department
semiconductor packaging in vlsi design fab
Unit 4 Computer Architecture Multicore Processor.pptx

Java Object Oriented Programming

  • 4. * Object Oriented Programming is a paradigm that provides many concepts such as inheritance, data binding, polymorphism etc.
  • 5. * It simplifies the software development and maintenance by providing some concepts: Object Class Inheritance Polymorphism Abstraction Encapsulation
  • 6. Any entity that has state and behavior is known as an object. For example: chair, pen, table, keyboard, bike etc. It can be physical and logical. An object has three characteristics: state: represents data (value) of an object. behavior: represents the behavior (functionality) of an object such as deposit, withdraw etc. identity: Object identity is typically implemented via a unique ID. The value of the ID is not visible to the external user. But, it is used internally by the JVM to identify each object uniquely.
  • 7. * Collection of objects is called class. It is a logical entity. A class is a group of objects that has common properties. It is a template or blueprint from which objects are created. A class in java can contain: data member method constructor block class and interface
  • 8. * When one object acquires all the properties and behaviors of parent object i.e. known as inheritance. It provides code reusability. It is used to achieve runtime polymorphism.
  • 9. * When one task is performed by different ways i.e. known as polymorphism. For example: to convense the customer differently, to draw something e.g. shape or rectangle etc. In java, we use method overloading and method overriding to achieve polymorphism. Another example can be to speak something e.g. cat speaks meaw, dog barks woof etc.
  • 10. * Hiding internal details and showing functionality is known as abstraction. For example: phone call, we don't know the internal processing. In java, we use abstract class and interface to achieve abstraction.
  • 11. * Binding (or wrapping) code and data together into a single unit is known as encapsulation. For example: capsule, it is wrapped with different medicines. A java class is the example of encapsulation. Java bean is the fully encapsulated class because all the data members are private here.
  • 12. * By using standard Java naming conventions, you make your code easier to read for yourself and for other programmers. Readability of Java program is very important. It indicates that less time is spent to figure out what the code does.
  • 13. * Java follows camelcase syntax for naming the class, interface, method and variable. If name is combined with two words, second word will start with uppercase letter always e.g. actionPerformed(), firstName, ActionEvent, ActionListener etc.
  • 14. *
  • 15. * If a class have multiple methods by same name but different parameters, it is known as Method Overloading. There are two ways to overload the method in java: By changing number of arguments By changing the data type
  • 16. *
  • 17. * Constructor in java is a special type of method that is used to initialize the object. Rules for creating java constructor There are basically two rules defined for the constructor. Constructor name must be same as its class name Constructor must have no explicit return type
  • 18. * Default constructor provides the default values to the object like 0, null etc. depending on the type.
  • 19. Java parameterized constructor A constructor that have parameters is known as parameterized constructor. Why use parameterized constructor? Parameterized constructor is used to provide different values to the distinct objects.
  • 20. * There can be a lot of usage of java this keyword. In java, this is a reference variable that refers to the current object.
  • 21. * If subclass (child class) has the same method as declared in the parent class, it is known as method o Usage of Java Method Overriding Method overriding is used to provide specific implementation of a method that is already provided by its super class. Method overriding is used for runtime polymorphism Rules for Java Method Overriding method must have same name as in the parent class method must have same parameter as in the parent class. must be IS-A relationship (inheritance).