SlideShare a Scribd company logo
L 1.1
Need for OOP Paradigm
 OOP is an approach to program organization and
development, which attempts to eliminate some of
the drawbacks of conventional programming
methods by incorporating the best of structured
programming features with several new concepts.
 OOP allows us to decompose a problem into
number of entities called objects and then build
data and methods (functions) around these entities.
 The data of an object can be accessed only by the
methods associated with the object.
L 1.2
Some of the Object-Oriented Paradigm are:
1. Emphasis is on data rather than procedure.
2. Programs are divided into objects.
3. Data Structures are designed such that they
Characterize the objects.
4 Methods that operate on the data of an object
are tied together in the data structure.
5 Data is hidden and can not be accessed by
external functions.
6 Objects may communicate with each other
through methods.
L 1.3
A way of viewing world – Agents
• OOP uses an approach of treating a real world
agent as an object.
• Object-oriented programming organizes a
program around its data (that is, objects) and a
set of well-defined interfaces to that data.
• An object-oriented program can be
characterized as data controlling access to code
by switching the controlling entity to data.
L 1.4
L 2.1
Responsibility
• primary motivation is the need for a platform-
independent (that is, architecture- neutral)
language that could be used to create software to
be embedded in various consumer electronic
devices, such as microwave ovens and remote
controls.
• Objects with clear responsibilities
• Each class should have a clear responsibility.
• If you can't state the purpose of a class in a single,
clear sentence, then perhaps your class structure
needs some thought.
L 2.2
Messages
• We all like to use programs that let us know
what's going on. Programs that keep us
informed often do so by displaying status and
error messages.
• These messages need to be translated so they
can be understood by end users around the
world.
• The Section discusses translatable text
messages. Usually, you're done after you move
a message String into a ResourceBundle.
• If you've embedded variable data in a message,
you'll have to take some extra steps to prepare it
for translation.
L 2.3
Methods
• A method is a group of instructions that is given a name and
can be called up at any point in a program simply by quoting
that name.
• Drawing a Triangle require draw of three straight lines. This
instruction three times to draw a simple triangle.
• We can define a method to call this instruction three times and
draw the triangle(i.e. create a method drawLine() to draw lines
and this method is called repeatedly to achieve the needed
task)
• The idea of methods appears in all programming languages,
although sometimes it goes under the name functions and
sometimes under the name procedures.
• The name methods is a throw-back to the language C++, from
which Java was developed.
• In C++, there is an object called a class which can contain
methods. However, everything in Java is enclosed within a
class .so the functions within it are called methods
L 3.1
CLASSES
• Class is blue print or an idea of an Object
• From One class any number of Instances can be
created
• It is an encapsulation of attributes and methods
FIGURE
CIRCLE
RECTANGLE
SQUARE
Ob1
Ob2
Ob3
class
L 3.2
syntax of CLASS
class <ClassName>
{
attributes/variables;
Constructors();
methods();
}
L 3.3
INSTANCE
• Instance is an Object of a class which
is an entity with its own attribute
values and methods.
• Creating an Instance
ClassName refVariable;
refVariable = new Constructor();
or
ClassName refVariable = new Constructor();
L 3.4
Java Class Hierarchy
• In Java, class “Object” is the base class to
all other classes
– If we do not explicitly say extends in a new
class definition, it implicitly extends Object
– The tree of classes that extend from Object
and all of its subclasses are is called the class
hierarchy
– All classes eventually lead back up to Object
– This will enable consistent access of objects
of different classes.
L 3.5
Inheritance
• Methods allows to reuse a sequence of
statements
• Inheritance allows to reuse classes by deriving a
new class from an existing one
• The existing class is called the parent class, or
superclass, or base class
• The derived class is called the child class or
subclass.
• The child class inherits characteristics of the
parent class(i.e the child class inherits the
methods and data defined for the parent class
L 3.6
Inheritance
• Inheritance relationships are often shown
graphically in a class diagram, with the
arrow pointing to the parent class
Animal
weight : int
+ getWeight() : int
Bird
+ fly() : void
L 4.1
Method Binding
• Objects are used to call methods.
• MethodBinding is an object that can be used to call an
arbitrary public method, on an instance that is acquired by
evaluatng the leading portion of a method binding
expression via a value binding.
• It is legal for a class to have two or more methods with the
same name.
• Java has to be able to uniquely associate the invocation of
a method with its definition relying on the number and
types of arguments.
• Therefore the same-named methods must be
distinguished:
1) by the number of arguments, or
2) by the types of arguments
• Overloading and inheritance are two ways to implement
polymorphism.
L 4.2
Method Overriding.
 There may be some occasions when we want an object
to respond to the same method but have different
behaviour when that method is called.
 That means, we should override the method defined in
the superclass. This is possible by defining a method in
a sub class that has the same name, same arguments
and same return type as a method in the superclass.
 Then when that method is called, the method defined in
the sub class is invoked and executed instead of the one
in the superclass. This is known as overriding.
L 4.3
Exceptions in Java
• Exception is an abnormal condition that arises in the
code sequence.
• Exceptions occur during compile time or run time.
• “throwable” is the super class in exception hierarchy.
• Compile time errors occurs due to incorrect syntax.
• Run-time errors happen when
– User enters incorrect input
– Resource is not available (ex. file)
– Logic error (bug) that was not fixed
L 4.4
Exception classes
• In Java, exceptions are objects. When you throw an exception,
you throw an object. You can't throw just any object as an
exception, however -- only those objects whose classes
descend from Throwable.
• Throwable serves as the base class for an entire family of
classes, declared in java.lang, that your program can instantiate
and throw.
• Throwable has two direct subclasses, Exception and Error.
• Exceptions are thrown to signal abnormal conditions that can
often be handled by some catcher, though it's possible they
may not be caught and therefore could result in a dead thread.
• Errors are usually thrown for more serious problems, such as
OutOfMemoryError, that may not be so easy to handle. In
general, code you write should throw only exceptions, not
errors.
• Errors are usually thrown by the methods of the Java API, or by
the Java virtual machine itself.
L 4.5
L 5.1
Summary of OOPS
The following are the basic oops concepts:
They are as follows:
1. Objects.
2. Classes.
3. Data Abstraction.
4. Data Encapsulation.
5. Inheritance.
6. Polymorphism.
7. Dynamic Binding.
8. Message Passing.
L 5.2
Abstraction in Object-Oriented Programming
Procedural Abstraction
• Procedural Abstractions organize instructions.
Function Power
Give me two numbers (base & exponent)
I’ll return baseexponent
Implementation
L 5.3
Data Abstraction
• Data Abstractions organize data.
Name (string)
Marks (num)
Grade (char)
Student Number (num)
StudentType
L 5.4
Behavioral Abstraction
• Behavioral Abstractions combine
procedural and data abstractions.
Data State
Enqueue
Is Full
Is Empty Dequeue
Initialize
Queue Object

More Related Content

PPT
VTU JAVA PPT BY DJ AND BEST PPT C ON JAVA
PPT
JAVA_8_.ppt all introduction to java topics
PPT
Java Notes
PPT
Unit 1 Java
PPTX
UNIT I OOP AND JAVA FUNDAMENTALS CONSTRUCTOR
PPTX
JAVA-PPT'S-complete-chrome.pptx
PPTX
JAVA-PPT'S.pptx
PDF
JAVA-PPT'S.pdf
VTU JAVA PPT BY DJ AND BEST PPT C ON JAVA
JAVA_8_.ppt all introduction to java topics
Java Notes
Unit 1 Java
UNIT I OOP AND JAVA FUNDAMENTALS CONSTRUCTOR
JAVA-PPT'S-complete-chrome.pptx
JAVA-PPT'S.pptx
JAVA-PPT'S.pdf

Similar to Need of object oriented programming paradigam (20)

PDF
2.oop concept
PDF
Chapter2 bag2
PPTX
Intro to object oriented programming.pptx
PPTX
Java basics
PPTX
Suga java training_with_footer
PDF
Oops concepts || Object Oriented Programming Concepts in Java
PPTX
SKILLWISE - OOPS CONCEPT
PPTX
Introduction to Java -unit-1
PPTX
INTRODUCTION TO JAVA
PPTX
OOPS in java | Super and this Keyword | Memory Management in java | pacakages...
PDF
Java Programming - 04 object oriented in java
PPT
Core Java unit no. 1 object and class ppt
PPTX
130704798265658191
PPTX
java part 1 computer science.pptx
PDF
12th ip CBSE chapter 4 oop in java notes complete
PPTX
object oriented programming through java basics
PPTX
Android Training (Java Review)
PPT
Data Hiding and Data Encapsulation of java
PPTX
03 Java Language And OOP Part III
PDF
Ah java-ppt2
2.oop concept
Chapter2 bag2
Intro to object oriented programming.pptx
Java basics
Suga java training_with_footer
Oops concepts || Object Oriented Programming Concepts in Java
SKILLWISE - OOPS CONCEPT
Introduction to Java -unit-1
INTRODUCTION TO JAVA
OOPS in java | Super and this Keyword | Memory Management in java | pacakages...
Java Programming - 04 object oriented in java
Core Java unit no. 1 object and class ppt
130704798265658191
java part 1 computer science.pptx
12th ip CBSE chapter 4 oop in java notes complete
object oriented programming through java basics
Android Training (Java Review)
Data Hiding and Data Encapsulation of java
03 Java Language And OOP Part III
Ah java-ppt2
Ad

More from RahulBhole12 (20)

PPT
Chapter 7 Basic Building of SE Architecture.ppt
PPT
Chapter 6 Software Engineering Design.ppt
PPT
Chapter 5 Analysis Modeling of Software Engineering.ppt
PPT
Chapter 4 Requirement of Engineering.ppt
PPT
Chapter 3 Software Process Model of .ppt
PPT
Chapter 1 Introduction to software Engineering.ppt
PPT
Chapter 1 Introduction to software engineering.ppt
PPT
Chapter 6 Design in software Engineeing.ppt
PPT
Chapter 2 Software Process models of SE.ppt
PPT
Introduction to java programming Packages
PPT
Introduction to java programming language
PPT
CC_virtualization is in the cloud UNIT 3.1.ppt
PPTX
computer network basic topologies type.pptx
PPTX
Cloud Security in cloud computing 1.pptx
PPT
cloud computing virtual machine UNIT 5 PPT
PPTX
Cloud computing UNIT 2.1 presentation in
PPTX
Cloud interconnection networks basic .pptx
PPTX
Basic ppt on cloud computing on amazon web
PPTX
Cloud Computing basic concept to understand
PDF
industry 4.pdf the whole syllabus of bsc
Chapter 7 Basic Building of SE Architecture.ppt
Chapter 6 Software Engineering Design.ppt
Chapter 5 Analysis Modeling of Software Engineering.ppt
Chapter 4 Requirement of Engineering.ppt
Chapter 3 Software Process Model of .ppt
Chapter 1 Introduction to software Engineering.ppt
Chapter 1 Introduction to software engineering.ppt
Chapter 6 Design in software Engineeing.ppt
Chapter 2 Software Process models of SE.ppt
Introduction to java programming Packages
Introduction to java programming language
CC_virtualization is in the cloud UNIT 3.1.ppt
computer network basic topologies type.pptx
Cloud Security in cloud computing 1.pptx
cloud computing virtual machine UNIT 5 PPT
Cloud computing UNIT 2.1 presentation in
Cloud interconnection networks basic .pptx
Basic ppt on cloud computing on amazon web
Cloud Computing basic concept to understand
industry 4.pdf the whole syllabus of bsc
Ad

Recently uploaded (20)

PPTX
Geodesy 1.pptx...............................................
PPTX
Strings in CPP - Strings in C++ are sequences of characters used to store and...
PPTX
web development for engineering and engineering
PDF
composite construction of structures.pdf
PDF
keyrequirementskkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkk
PDF
July 2025 - Top 10 Read Articles in International Journal of Software Enginee...
PDF
Mohammad Mahdi Farshadian CV - Prospective PhD Student 2026
PPTX
Welding lecture in detail for understanding
PDF
Model Code of Practice - Construction Work - 21102022 .pdf
PDF
Embodied AI: Ushering in the Next Era of Intelligent Systems
PDF
Structs to JSON How Go Powers REST APIs.pdf
PDF
Digital Logic Computer Design lecture notes
PDF
The CXO Playbook 2025 – Future-Ready Strategies for C-Suite Leaders Cerebrai...
PDF
BMEC211 - INTRODUCTION TO MECHATRONICS-1.pdf
PDF
Well-logging-methods_new................
PDF
PRIZ Academy - 9 Windows Thinking Where to Invest Today to Win Tomorrow.pdf
PPTX
MET 305 2019 SCHEME MODULE 2 COMPLETE.pptx
PPTX
UNIT-1 - COAL BASED THERMAL POWER PLANTS
PPTX
Infosys Presentation by1.Riyan Bagwan 2.Samadhan Naiknavare 3.Gaurav Shinde 4...
PPTX
Recipes for Real Time Voice AI WebRTC, SLMs and Open Source Software.pptx
Geodesy 1.pptx...............................................
Strings in CPP - Strings in C++ are sequences of characters used to store and...
web development for engineering and engineering
composite construction of structures.pdf
keyrequirementskkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkk
July 2025 - Top 10 Read Articles in International Journal of Software Enginee...
Mohammad Mahdi Farshadian CV - Prospective PhD Student 2026
Welding lecture in detail for understanding
Model Code of Practice - Construction Work - 21102022 .pdf
Embodied AI: Ushering in the Next Era of Intelligent Systems
Structs to JSON How Go Powers REST APIs.pdf
Digital Logic Computer Design lecture notes
The CXO Playbook 2025 – Future-Ready Strategies for C-Suite Leaders Cerebrai...
BMEC211 - INTRODUCTION TO MECHATRONICS-1.pdf
Well-logging-methods_new................
PRIZ Academy - 9 Windows Thinking Where to Invest Today to Win Tomorrow.pdf
MET 305 2019 SCHEME MODULE 2 COMPLETE.pptx
UNIT-1 - COAL BASED THERMAL POWER PLANTS
Infosys Presentation by1.Riyan Bagwan 2.Samadhan Naiknavare 3.Gaurav Shinde 4...
Recipes for Real Time Voice AI WebRTC, SLMs and Open Source Software.pptx

Need of object oriented programming paradigam

  • 1. L 1.1 Need for OOP Paradigm  OOP is an approach to program organization and development, which attempts to eliminate some of the drawbacks of conventional programming methods by incorporating the best of structured programming features with several new concepts.  OOP allows us to decompose a problem into number of entities called objects and then build data and methods (functions) around these entities.  The data of an object can be accessed only by the methods associated with the object.
  • 2. L 1.2 Some of the Object-Oriented Paradigm are: 1. Emphasis is on data rather than procedure. 2. Programs are divided into objects. 3. Data Structures are designed such that they Characterize the objects. 4 Methods that operate on the data of an object are tied together in the data structure. 5 Data is hidden and can not be accessed by external functions. 6 Objects may communicate with each other through methods.
  • 3. L 1.3 A way of viewing world – Agents • OOP uses an approach of treating a real world agent as an object. • Object-oriented programming organizes a program around its data (that is, objects) and a set of well-defined interfaces to that data. • An object-oriented program can be characterized as data controlling access to code by switching the controlling entity to data.
  • 5. L 2.1 Responsibility • primary motivation is the need for a platform- independent (that is, architecture- neutral) language that could be used to create software to be embedded in various consumer electronic devices, such as microwave ovens and remote controls. • Objects with clear responsibilities • Each class should have a clear responsibility. • If you can't state the purpose of a class in a single, clear sentence, then perhaps your class structure needs some thought.
  • 6. L 2.2 Messages • We all like to use programs that let us know what's going on. Programs that keep us informed often do so by displaying status and error messages. • These messages need to be translated so they can be understood by end users around the world. • The Section discusses translatable text messages. Usually, you're done after you move a message String into a ResourceBundle. • If you've embedded variable data in a message, you'll have to take some extra steps to prepare it for translation.
  • 7. L 2.3 Methods • A method is a group of instructions that is given a name and can be called up at any point in a program simply by quoting that name. • Drawing a Triangle require draw of three straight lines. This instruction three times to draw a simple triangle. • We can define a method to call this instruction three times and draw the triangle(i.e. create a method drawLine() to draw lines and this method is called repeatedly to achieve the needed task) • The idea of methods appears in all programming languages, although sometimes it goes under the name functions and sometimes under the name procedures. • The name methods is a throw-back to the language C++, from which Java was developed. • In C++, there is an object called a class which can contain methods. However, everything in Java is enclosed within a class .so the functions within it are called methods
  • 8. L 3.1 CLASSES • Class is blue print or an idea of an Object • From One class any number of Instances can be created • It is an encapsulation of attributes and methods FIGURE CIRCLE RECTANGLE SQUARE Ob1 Ob2 Ob3 class
  • 9. L 3.2 syntax of CLASS class <ClassName> { attributes/variables; Constructors(); methods(); }
  • 10. L 3.3 INSTANCE • Instance is an Object of a class which is an entity with its own attribute values and methods. • Creating an Instance ClassName refVariable; refVariable = new Constructor(); or ClassName refVariable = new Constructor();
  • 11. L 3.4 Java Class Hierarchy • In Java, class “Object” is the base class to all other classes – If we do not explicitly say extends in a new class definition, it implicitly extends Object – The tree of classes that extend from Object and all of its subclasses are is called the class hierarchy – All classes eventually lead back up to Object – This will enable consistent access of objects of different classes.
  • 12. L 3.5 Inheritance • Methods allows to reuse a sequence of statements • Inheritance allows to reuse classes by deriving a new class from an existing one • The existing class is called the parent class, or superclass, or base class • The derived class is called the child class or subclass. • The child class inherits characteristics of the parent class(i.e the child class inherits the methods and data defined for the parent class
  • 13. L 3.6 Inheritance • Inheritance relationships are often shown graphically in a class diagram, with the arrow pointing to the parent class Animal weight : int + getWeight() : int Bird + fly() : void
  • 14. L 4.1 Method Binding • Objects are used to call methods. • MethodBinding is an object that can be used to call an arbitrary public method, on an instance that is acquired by evaluatng the leading portion of a method binding expression via a value binding. • It is legal for a class to have two or more methods with the same name. • Java has to be able to uniquely associate the invocation of a method with its definition relying on the number and types of arguments. • Therefore the same-named methods must be distinguished: 1) by the number of arguments, or 2) by the types of arguments • Overloading and inheritance are two ways to implement polymorphism.
  • 15. L 4.2 Method Overriding.  There may be some occasions when we want an object to respond to the same method but have different behaviour when that method is called.  That means, we should override the method defined in the superclass. This is possible by defining a method in a sub class that has the same name, same arguments and same return type as a method in the superclass.  Then when that method is called, the method defined in the sub class is invoked and executed instead of the one in the superclass. This is known as overriding.
  • 16. L 4.3 Exceptions in Java • Exception is an abnormal condition that arises in the code sequence. • Exceptions occur during compile time or run time. • “throwable” is the super class in exception hierarchy. • Compile time errors occurs due to incorrect syntax. • Run-time errors happen when – User enters incorrect input – Resource is not available (ex. file) – Logic error (bug) that was not fixed
  • 17. L 4.4 Exception classes • In Java, exceptions are objects. When you throw an exception, you throw an object. You can't throw just any object as an exception, however -- only those objects whose classes descend from Throwable. • Throwable serves as the base class for an entire family of classes, declared in java.lang, that your program can instantiate and throw. • Throwable has two direct subclasses, Exception and Error. • Exceptions are thrown to signal abnormal conditions that can often be handled by some catcher, though it's possible they may not be caught and therefore could result in a dead thread. • Errors are usually thrown for more serious problems, such as OutOfMemoryError, that may not be so easy to handle. In general, code you write should throw only exceptions, not errors. • Errors are usually thrown by the methods of the Java API, or by the Java virtual machine itself.
  • 18. L 4.5
  • 19. L 5.1 Summary of OOPS The following are the basic oops concepts: They are as follows: 1. Objects. 2. Classes. 3. Data Abstraction. 4. Data Encapsulation. 5. Inheritance. 6. Polymorphism. 7. Dynamic Binding. 8. Message Passing.
  • 20. L 5.2 Abstraction in Object-Oriented Programming Procedural Abstraction • Procedural Abstractions organize instructions. Function Power Give me two numbers (base & exponent) I’ll return baseexponent Implementation
  • 21. L 5.3 Data Abstraction • Data Abstractions organize data. Name (string) Marks (num) Grade (char) Student Number (num) StudentType
  • 22. L 5.4 Behavioral Abstraction • Behavioral Abstractions combine procedural and data abstractions. Data State Enqueue Is Full Is Empty Dequeue Initialize Queue Object