SlideShare a Scribd company logo
Fundamental concepts of object
oriented programming
Overview of programming
• Programming: programming language is
artificial human created language which
translates instruction from human redable
to computer readable format.
• Programming is art of solving
computational problems by.
• To solve these problems we use
programminglanguage.
Concepts of Procedure oriented
programming
Procedure Oriented Programming(POP)
• Programming languages such as like
COBOL ,FORTRAN,C (using high level
languages) were based on Procedural
Oriented Programming(POP) language.
• POP language program uses branching
statements and procedures to execute one or
other set of instructions, depending on the
result that you want.
• Procedure also known as a routine or
subroutine or a function.
Procedure-Oriented Programming
• Procedure-oriented programming basically
consists of writing a list of instructions for
the computer to follow and organizing these
instructions into groups known as functions.
• When you write large programs in Procedure
Language ,they are complex to understand
and hard to program.
Note:Procedural programming is a programming
paradigm in which a program is composed of one
or more procedures which are invoked in a
particular order to achieve the desired result. Every
procedure is a set of instructions representing a
specific task.
Note:
• In structured programming(like c) we can
overcome this problems by dividing a
Large program into different functions.
• But it gives birth to other problem.
• Structured programmingis any
programmingwhen functionality is
divided into units like for loop, while
loop, if... then etc block structure.
Also, here the a piece of code
(function) can be re-used.
Typical structure of procedure-oriented program
Function-1 Function-2 Function-3
Global data
Main function
Local data
Function-4 Function-5
Function-6 Function-7 Function-8
Characteristics of Procedure-
Oriented Programming
• Large programs are divided into smaller
programs known as functions.
• Most of the functions share global data.
• Data move openly around the system from
function to function.
• Functions transform data from one form to
another.
• Employs top-down approach in program
design.
Relationship of data and functions in
procedural programming
Global Data Global Data
Function-1 Function-2 Function-3
Local Data Local Data Local Data
Problem of Procedure
oriented programming?
• In procedural language main problem are
The functions have unrestricted access to
global data.
• No security for data. If we declare a variable
before main function then it can be accessed
freely from any function present in the
program.
• No better memory management.
• Difficult to implement today's client
requirements
Problem of Procedure
oriented programming?
• No structure or code reusability. Hence time
of development, testing and length of
program increases.
• As length of application increases it causes
slow performance.
• Code maintenance and enhancements are
difficult.
• No proper way method for Exception
handling (error handling).
Some other Problem of Procedure
oriented programming?
• Computer languages generally have built-in
data type : interger,character,float etc.
When we try to invent a new data type or a
user-define data type. Then it become very
default to create it.
• e.g. we work with dates or complex no. then it
becomes very difficult to work with built in
types .
• Crating your own data types is a feature called
of extensibility.
• Procedure oriented language are not extensible
This problem is overcome by with the
development of new programming technique
known as object oriented programming(OOP).
Procedure-Oriented Programming
Procedure-Oriented Programming
• POP the emphasis is on functions rather than
data, and data is also not secured in this
approach.
• The OOP approach eliminates these
weakness of POP by combining the data and
the function that work on it into a single unit
called class.
• So the data is secured from the outside world
• OOP is implemented on the real-world
entities called objects that have some
characteristics and behavior,
Fundamental concepts of object
oriented programming
Contents
1. What is OOP?
2. Classes and Objects
3. Basic Concepts of OOP
Abstraction
Encapsulation
Polymorphism
What is OOP?
• Object Oriented Programming(OOP) is an
Engineering approach for building software
systems.
• Based on the concepts of classes and object
that are used for modeling the real world
entities.
What is OOP?
 Better suited for….team development.
 Facilitated utilizing and creating
reusable software components.
 Easier for GUI Programming
 Easier for Software maintenance
 All modern language are object
oriented: Java, C#, PHP, Perl,
C++,...…..
Real world object
• In physical world we deal with object like
person or car.
• Such object not like data and functions.
• In complex real world situations we have
attributes & behavior.
Attributes :
• Every object has some attribute different
types of objects contain different attributes
or characteristics.
• Example :
The student are name,rollnumber,subject
The attribute for car whould be color,
engine power,number of seates etc.
• Attribute are real world are like data they
have some specific value Raj(for name) or
23(roll number).
Behavior
• Behavior actually determines the way
an objects interacts with other objects.
• Like function to do some task.
• e.g if manager orders an employee to do
some task then he responds either by doing
it or not doingit.
OOP …Object
continue …
• In Object Oriented Programming deals
with similar objects.
• The data of anobject canbe accessed only
by the functions associated with that object.
• Functions of one object can access
the functions of another objects.
Organization of data and functions in OOP
Data
Functions
Data
Functions
Communication
Data
Functions
Basic Concepts of Object-Oriented
Programming
• Objects
• Classes
• Data Abstraction and Encapsulation
• Inheritance
• Polymorphism
• Dynamic Binding
• Message Passing
Objectsin OOP
• Object are the basic run-time entities in an
object-oriented system.
• They may represent aperson, aplace ,
abank account, a table of data or
• Objects take up space in the memory
• When aprogram is executed, the objects
interact by sending messages to one another
OBJECT
HAS DOES
color
diameter
brand
bounce
roll
properties behavior
If there are two objects customer and account
then the customer object may send a message to
account object ..requesting for the bank balance.
Object : CUSTOMER Object :ACCOUNT
Objects example
DATA
AC No.
Name of AC Holder
Address
FUNCTIONS
Deposit
Withdrawal
AC Balance Display
DATA
AC No.
AC Balance
T
ype of Account
FUNCTIONS
Account Balance
Classes
• A class is user-defined data type which contains
data members and member
functions...Members function operate those
data Members.
• Classes are user defined data types and behaves
like the built in type of aprogramming language.
• Once a class has been defined, we can create any
number of objects belonging to that class. Thus a
class is collection of objects of similar type.
• class is collection of similar kind of objects.
OBJECT
Classes :The entire set of data & code of an object can be
made a user-defined data type with the help of a class.Objects
are actually variable of the type class
HAS DOES
color
diameter
brand
bounce
roll
properties behavior
Classes
• A Class is a collection of fields (data)
and methods (procedure or
function) that operate on that data.
• Class are just like the blueprints of objects
that model real world things.
• one of advantage of using classes is that
once you have created a class for acertain
type of object you canreuse that class in
any project.
A class Is defined by 3element
1.A unique class name
2.Data members or attributes
3.Member functions or methods
circle
centre
radius
circumference()
circumference()
area()
Circle
centre
radius
circumference()
area()
SE-IT JAVA LAB OOP CONCEPT
SE-IT JAVA LAB OOP CONCEPT
SE-IT JAVA LAB OOP CONCEPT
OBJECT
A class describes an object
HAS DOES
color
diameter
brand
bounce
roll
properties behavior
OBJECT
a classdescribes an object
Class ball
String color;
float diameter;
String brand;
void bounce(float h)
void roll (float d)
HAS DOES
color
diameter
brand
bounce
roll
properties behavior
Circle ball
String color;
Float diameter;
Data members
String brand;
void bounce(float h)
void roll (float d)
Members methods
The syntax for defining classin c++:
class class_name
{
private :
variable declarations;
functions
declarations; public:
variable declarations;
functions declarations;
};
void main()
{
class_name variabale_name;
….
}
The syntax for defining class in java :
class class_name
{
private
variable declarations;
functions
declarations; public
variable declarations;
functions declarations;
}
class mainclass_name
{
public static void main(String args[])
{
class_name variabale_name=new class_name( );
….
}
}
example of class in Java
class ball
{
String color;
float diameter;
String brand;
void bounce(float h)
{ }
void roll (float d)
{ }
}
class ballmain
{
public static void main (String args[ ])
{
/
/Following statement
would create an object
ball b=new ball( );
}
}
SE-IT JAVA LAB OOP CONCEPT
SE-IT JAVA LAB OOP CONCEPT
SE-IT JAVA LAB OOP CONCEPT
SE-IT JAVA LAB OOP CONCEPT
SE-IT JAVA LAB OOP CONCEPT
SE-IT JAVA LAB OOP CONCEPT
Ball b =new Ball();
b.color=“white”;
b.diam=2.0f;
b.brand=“nike”;
b.bounce();
b.boll();
SE-IT JAVA LAB OOP CONCEPT
SE-IT JAVA LAB OOP CONCEPT
SE-IT JAVA LAB OOP CONCEPT
OBJECT
Properties
i.e data member
Behavior
i.e method
Basic Concepts of OOP
Data Abstraction and Encapsulation
oThe wrapping up of data and functions into a
single unit is known as encapsulation.
oThe data is not accessible to the outside world,
and only those functions which are wrapped in the
class can access it.
oThese functions provide the interface between
the object’s data and the program. This insulation
of the data from direct access by the program is
called data hiding or information hiding.
Data Abstraction & Encapsulation
oThe attributes wrapped in the classesare
called data members and the functions that
operate on these data are called methods or
member functions.
oSince the classes use the concept of data
abstraction, they are known as Abstracted
Data Types (ADT).
Basic Concepts of OOP
Data Abstraction :
The concept of abstraction isclosely related
to the concept of data or information hiding
abstraction separates qualities of data type
& the associated implementation detailed.
this helps the properties of the abstract
data types user interface while the
implementation detailed remain hidden.
Inheritance
o Inheritance is the process by which objects of
one class acquire the properties of objects of
a
c
o
n
n
o
t
i
n
t
u
h
e
e
…
rclass.
o It supports the concept of
hierarchical classification.
o Inheritance is a compile-time mechanism in Java
that allows you to extend a class (called the
baseclass or superclass) with another class
(called the derived class or subclass) or
o The mechanismof deriving a class from another
existing class is called as inheritance .
o Access specifies:- public, protected
,private, default. 
Property Inheritance
Bird
Attributes:
Feathers
Lay eggs
Flying Bird Non-flying Bird
Attributes:
------------
------------
Attributes:
------------
------------
Robin
Attributes:
------------
------------
Swallow
Attributes:
------------
------------
Penguin
Attributes:
------------
------------
Kiwi
Attributes:
------------
------------
Derived class-base class declaration syntax in Inheritance :
class A
{
……………
……………..
}
class B extends A
{
…………..
……………
}
class c extends B
{
……………
…………… }
Inheritance :
o Inheritance provides the idea of
reusability.
oWe can add additional features to an existing
class without modifying it.
(By deriving new class from existing one. The
new class will have the combined features of both
the classes.)
Basic Concepts of OOP
Polymorphism:ability to take more than one form
o An operation may exhibit different behaviors
in different instances.
o The behaviour depends upon the types of
data used in the operation.
o add( 3, 5) gives 8.
o Add(“hello”, “-world”) gives “hello-world”.
Polymorphism
o ability to take more than one form
oThe process of makingan operator to exhibit
differen
t behaviors in different instances is known as operator
overloading.
<
< Insertion Operator
<
< Left-shift bit-wise operator
oUsing asingle function name to perform different types of
tasks is known as function overloading.
add( 3, 5) gives 8
Add(“hello”, “-world”) gives “hello-world”
Dynamic Binding
o Binding refers to the linking of a procedure call
to the code to be executed in response to the
call.
o Dynamic binding (late binding ) means that the
code associatedwith agivenprocedure call is
not known until the time of the call at run-
time.It is associated with polymorphism &
inheritance.
Message Passing
• An oop consists of a set of objects that
communicate with each other.
• oop involves the following steps:
oCreating classes that define objects and theirbehaviour.
oCreating objects from class definitions.
oEstablishing communication amongobjects.
•Objects communicate with one another by
sending and receiving information.
Basic Concepts of OOP
Message Passing
o A message for an object is a request for
execution of a procedure.
o The receiving object will invoke a
function and generates results.
o Message passing involves :
oThe name of the Object.
oThe name of the Function.
oThe information to be send.
Benefits of OOP
• Inheritance – eliminate redundant code and
extend the use of existing classes.
•
• We can build programs from the standard
working module.
secure programs that can not be invade by code
in other parts of the program.
• Multiple instances of an objects can co-exists
with out any interference.
Benefits of OOP
• It is easy to partition the work in a
project based on objects.
• Object-oriented system can be easily
upgraded from small to large systems.
•
communication between objects
makes the interface descriptions with
external systems much simpler.
• Software complexity can be easily
managed.
Characteristics of Object-Oriented Programming
• Importance is on data.
• Programs are divided into objects.
• Objects may communicate with each other
through functions.
• Data structures are designed such that they
• Functions that operate on the data of an object
are tied together in the data structure.
• Data is hidden and can not be accessed
by external functions.
• New data and functions can be added easily
whenever necessary.
Difference Between Procedure Oriented Programming
(POP) & Object Oriented Programming (OOP)
Procedure Oriented
Programming
Object Oriented
Programming
Divided Into
In POP, program is divided
into small parts
called functions.
In OOP, program is divided into
parts called objects.
Importance
In POP,Importance is not
given to data but to functions
as well as sequence of actions
to be done.
In OOP, Importance is given to
the data rather than procedures
or functions because it works as
real world.
Approach
POP follows Top Down
approach.
OOP follows Bottom Up
approach.
Procedure Oriented Programming Object Oriented Programming
Access
Specifiers
POPdoes not have any access
specifier.
OOPhas access specifies named
Public, Private, Protected, etc.
In POP, Data can move freely
Data Moving from function to function in the
system.
In OOP, objects can move and
communicate with each other
through member functions.
Expansion
To add new data and function in
POPis not so easy.
OOPprovides an easy way to
add new data and function.
Procedure Oriented
Programming
Object Oriented
Programming
DataAccess
In POP, Most function uses
Global data for sharing that can
be accessed freely from function
to function in the system.
In OOP, data can not move
easily from function to
function,it can be kept
public or private so we can
control the access of data.
POPdoes not have any proper
OOPprovides Data Hiding
Data Hiding way for hiding data so it is less
secure.
so provides more security.
Overloading In POP, Overloading is not
possible.
In OOP, overloading is
possible in the form of
Function Overloading and
Operator Overloading.
Examples
Example of POPare : C, VB,
FORTRAN, Pascal.
Example of OOPare : C++,
JAVA, VB.NET, C#.NET.

More Related Content

PPSX
Object Oriented Programming Overview for the PeopleSoft Developer
PDF
Oop concepts classes_objects
PPT
Oops
PPTX
Introduction to Object Oriented Programming
PPTX
Oops concept in c++ unit 3 -topic 4
PPTX
Introduction to oop
PDF
C++ OOPS Concept
Object Oriented Programming Overview for the PeopleSoft Developer
Oop concepts classes_objects
Oops
Introduction to Object Oriented Programming
Oops concept in c++ unit 3 -topic 4
Introduction to oop
C++ OOPS Concept

What's hot (20)

PPTX
Object oriented programming
PPT
Introduction to oop
PPTX
SKILLWISE - OOPS CONCEPT
PPT
2 Object Oriented Programming
PPTX
OOPS with C++ | Concepts of OOPS | Introduction
PDF
Object Oriented Programming Lecture Notes
PDF
C++ [ principles of object oriented programming ]
PPTX
Characteristics of oop
PDF
Chapter 6 OOPS Concept
PPTX
Principles and advantages of oop ppt
PPTX
Characteristics of OOPS
PPTX
Object Oriented Programming
PPTX
concept of oops
PPTX
Object Oriented Programming Concepts
PPTX
Concepts of oops
PPTX
OOP Unit 1 - Foundation of Object- Oriented Programming
PPTX
1 unit (oops)
PPTX
Unit 1 OOSE
Object oriented programming
Introduction to oop
SKILLWISE - OOPS CONCEPT
2 Object Oriented Programming
OOPS with C++ | Concepts of OOPS | Introduction
Object Oriented Programming Lecture Notes
C++ [ principles of object oriented programming ]
Characteristics of oop
Chapter 6 OOPS Concept
Principles and advantages of oop ppt
Characteristics of OOPS
Object Oriented Programming
concept of oops
Object Oriented Programming Concepts
Concepts of oops
OOP Unit 1 - Foundation of Object- Oriented Programming
1 unit (oops)
Unit 1 OOSE
Ad

Similar to SE-IT JAVA LAB OOP CONCEPT (20)

PPTX
c++.pptxwjwjsijsnsksomammaoansnksooskskk
PDF
UNIT1- OBJECT ORIENTED PROGRAMMING IN JAVA- AIML IT-SPPU
PDF
C++ chapter 1
PPTX
OOP-1.pptx
PPTX
C++ in object oriented programming
PPT
Unit 1- Basic concept of object-oriented-programming.ppt
PPTX
Unit - I Intro. to OOP Concepts and Control Structure -OOP and CG (2024 Patte...
PPTX
Presentation c
PPT
Share Unit 1- Basic concept of object-oriented-programming.ppt
PPT
Java Fundamentalojhgghjjjjhhgghhjjjjhhj.ppt
PDF
C++ Programming with examples for B.Tech
PPTX
Different paradigms for problem solving.pptx
PPTX
Object Oriented Program Class 12 Computer Science
PPTX
Untitled presentation about object oriented.pptx
PPTX
The Big Picture
PDF
OOPS_Unit_1
PPTX
[OOP - Lec 01] Introduction to OOP
PPTX
Unit 1 introduction to c++.pptx
PPTX
Oop.pptx
c++.pptxwjwjsijsnsksomammaoansnksooskskk
UNIT1- OBJECT ORIENTED PROGRAMMING IN JAVA- AIML IT-SPPU
C++ chapter 1
OOP-1.pptx
C++ in object oriented programming
Unit 1- Basic concept of object-oriented-programming.ppt
Unit - I Intro. to OOP Concepts and Control Structure -OOP and CG (2024 Patte...
Presentation c
Share Unit 1- Basic concept of object-oriented-programming.ppt
Java Fundamentalojhgghjjjjhhgghhjjjjhhj.ppt
C++ Programming with examples for B.Tech
Different paradigms for problem solving.pptx
Object Oriented Program Class 12 Computer Science
Untitled presentation about object oriented.pptx
The Big Picture
OOPS_Unit_1
[OOP - Lec 01] Introduction to OOP
Unit 1 introduction to c++.pptx
Oop.pptx
Ad

More from nikshaikh786 (20)

PPTX
Module 2_ Divide and Conquer Approach.pptx
PPTX
Module 1_ Introduction.pptx
PPTX
Module 1_ Introduction to Mobile Computing.pptx
PPTX
Module 2_ GSM Mobile services.pptx
PPTX
MODULE 4_ CLUSTERING.pptx
PPTX
MODULE 5 _ Mining frequent patterns and associations.pptx
PDF
DWM-MODULE 6.pdf
PDF
TCS MODULE 6.pdf
PPTX
Module 3_ Classification.pptx
PPTX
Module 2_ Introduction to Data Mining, Data Exploration and Data Pre-processi...
PPTX
Module 1_Data Warehousing Fundamentals.pptx
PPTX
Module 2_ Cyber offenses & Cybercrime.pptx
PPTX
Module 1- Introduction to Cybercrime.pptx
PPTX
MODULE 5- EDA.pptx
PPTX
MODULE 4-Text Analytics.pptx
PPTX
Module 3 - Time Series.pptx
PPTX
Module 2_ Regression Models..pptx
PPTX
MODULE 1_Introduction to Data analytics and life cycle..pptx
PPTX
IOE MODULE 6.pptx
PDF
MAD&PWA VIVA QUESTIONS.pdf
Module 2_ Divide and Conquer Approach.pptx
Module 1_ Introduction.pptx
Module 1_ Introduction to Mobile Computing.pptx
Module 2_ GSM Mobile services.pptx
MODULE 4_ CLUSTERING.pptx
MODULE 5 _ Mining frequent patterns and associations.pptx
DWM-MODULE 6.pdf
TCS MODULE 6.pdf
Module 3_ Classification.pptx
Module 2_ Introduction to Data Mining, Data Exploration and Data Pre-processi...
Module 1_Data Warehousing Fundamentals.pptx
Module 2_ Cyber offenses & Cybercrime.pptx
Module 1- Introduction to Cybercrime.pptx
MODULE 5- EDA.pptx
MODULE 4-Text Analytics.pptx
Module 3 - Time Series.pptx
Module 2_ Regression Models..pptx
MODULE 1_Introduction to Data analytics and life cycle..pptx
IOE MODULE 6.pptx
MAD&PWA VIVA QUESTIONS.pdf

Recently uploaded (20)

PDF
BRKDCN-2613.pdf Cisco AI DC NVIDIA presentation
PDF
Embodied AI: Ushering in the Next Era of Intelligent Systems
PPTX
AgentX UiPath Community Webinar series - Delhi
PPTX
Simulation of electric circuit laws using tinkercad.pptx
PPTX
bas. eng. economics group 4 presentation 1.pptx
PPTX
Engineering Ethics, Safety and Environment [Autosaved] (1).pptx
PPTX
Practice Questions on recent development part 1.pptx
PDF
July 2025 - Top 10 Read Articles in International Journal of Software Enginee...
PPTX
MET 305 MODULE 1 KTU 2019 SCHEME 25.pptx
PPTX
Strings in CPP - Strings in C++ are sequences of characters used to store and...
PPTX
Fluid Mechanics, Module 3: Basics of Fluid Mechanics
PPTX
anatomy of limbus and anterior chamber .pptx
PDF
오픈소스 LLM, vLLM으로 Production까지 (Instruct.KR Summer Meetup, 2025)
PPTX
Internship_Presentation_Final engineering.pptx
PPT
Chapter 6 Design in software Engineeing.ppt
PPT
Project quality management in manufacturing
PPTX
MCN 401 KTU-2019-PPE KITS-MODULE 2.pptx
PDF
Operating System & Kernel Study Guide-1 - converted.pdf
PPT
Drone Technology Electronics components_1
PDF
Structs to JSON How Go Powers REST APIs.pdf
BRKDCN-2613.pdf Cisco AI DC NVIDIA presentation
Embodied AI: Ushering in the Next Era of Intelligent Systems
AgentX UiPath Community Webinar series - Delhi
Simulation of electric circuit laws using tinkercad.pptx
bas. eng. economics group 4 presentation 1.pptx
Engineering Ethics, Safety and Environment [Autosaved] (1).pptx
Practice Questions on recent development part 1.pptx
July 2025 - Top 10 Read Articles in International Journal of Software Enginee...
MET 305 MODULE 1 KTU 2019 SCHEME 25.pptx
Strings in CPP - Strings in C++ are sequences of characters used to store and...
Fluid Mechanics, Module 3: Basics of Fluid Mechanics
anatomy of limbus and anterior chamber .pptx
오픈소스 LLM, vLLM으로 Production까지 (Instruct.KR Summer Meetup, 2025)
Internship_Presentation_Final engineering.pptx
Chapter 6 Design in software Engineeing.ppt
Project quality management in manufacturing
MCN 401 KTU-2019-PPE KITS-MODULE 2.pptx
Operating System & Kernel Study Guide-1 - converted.pdf
Drone Technology Electronics components_1
Structs to JSON How Go Powers REST APIs.pdf

SE-IT JAVA LAB OOP CONCEPT

  • 1. Fundamental concepts of object oriented programming
  • 2. Overview of programming • Programming: programming language is artificial human created language which translates instruction from human redable to computer readable format. • Programming is art of solving computational problems by. • To solve these problems we use programminglanguage.
  • 3. Concepts of Procedure oriented programming
  • 4. Procedure Oriented Programming(POP) • Programming languages such as like COBOL ,FORTRAN,C (using high level languages) were based on Procedural Oriented Programming(POP) language. • POP language program uses branching statements and procedures to execute one or other set of instructions, depending on the result that you want. • Procedure also known as a routine or subroutine or a function.
  • 5. Procedure-Oriented Programming • Procedure-oriented programming basically consists of writing a list of instructions for the computer to follow and organizing these instructions into groups known as functions. • When you write large programs in Procedure Language ,they are complex to understand and hard to program. Note:Procedural programming is a programming paradigm in which a program is composed of one or more procedures which are invoked in a particular order to achieve the desired result. Every procedure is a set of instructions representing a specific task.
  • 6. Note: • In structured programming(like c) we can overcome this problems by dividing a Large program into different functions. • But it gives birth to other problem. • Structured programmingis any programmingwhen functionality is divided into units like for loop, while loop, if... then etc block structure. Also, here the a piece of code (function) can be re-used.
  • 7. Typical structure of procedure-oriented program Function-1 Function-2 Function-3 Global data Main function Local data Function-4 Function-5 Function-6 Function-7 Function-8
  • 8. Characteristics of Procedure- Oriented Programming • Large programs are divided into smaller programs known as functions. • Most of the functions share global data. • Data move openly around the system from function to function. • Functions transform data from one form to another. • Employs top-down approach in program design.
  • 9. Relationship of data and functions in procedural programming Global Data Global Data Function-1 Function-2 Function-3 Local Data Local Data Local Data
  • 10. Problem of Procedure oriented programming? • In procedural language main problem are The functions have unrestricted access to global data. • No security for data. If we declare a variable before main function then it can be accessed freely from any function present in the program. • No better memory management. • Difficult to implement today's client requirements
  • 11. Problem of Procedure oriented programming? • No structure or code reusability. Hence time of development, testing and length of program increases. • As length of application increases it causes slow performance. • Code maintenance and enhancements are difficult. • No proper way method for Exception handling (error handling).
  • 12. Some other Problem of Procedure oriented programming? • Computer languages generally have built-in data type : interger,character,float etc. When we try to invent a new data type or a user-define data type. Then it become very default to create it. • e.g. we work with dates or complex no. then it becomes very difficult to work with built in types . • Crating your own data types is a feature called of extensibility. • Procedure oriented language are not extensible
  • 13. This problem is overcome by with the development of new programming technique known as object oriented programming(OOP). Procedure-Oriented Programming
  • 14. Procedure-Oriented Programming • POP the emphasis is on functions rather than data, and data is also not secured in this approach. • The OOP approach eliminates these weakness of POP by combining the data and the function that work on it into a single unit called class. • So the data is secured from the outside world • OOP is implemented on the real-world entities called objects that have some characteristics and behavior,
  • 15. Fundamental concepts of object oriented programming
  • 16. Contents 1. What is OOP? 2. Classes and Objects 3. Basic Concepts of OOP Abstraction Encapsulation Polymorphism
  • 17. What is OOP? • Object Oriented Programming(OOP) is an Engineering approach for building software systems. • Based on the concepts of classes and object that are used for modeling the real world entities.
  • 18. What is OOP?  Better suited for….team development.  Facilitated utilizing and creating reusable software components.  Easier for GUI Programming  Easier for Software maintenance  All modern language are object oriented: Java, C#, PHP, Perl, C++,...…..
  • 19. Real world object • In physical world we deal with object like person or car. • Such object not like data and functions. • In complex real world situations we have attributes & behavior.
  • 20. Attributes : • Every object has some attribute different types of objects contain different attributes or characteristics. • Example : The student are name,rollnumber,subject The attribute for car whould be color, engine power,number of seates etc. • Attribute are real world are like data they have some specific value Raj(for name) or 23(roll number).
  • 21. Behavior • Behavior actually determines the way an objects interacts with other objects. • Like function to do some task. • e.g if manager orders an employee to do some task then he responds either by doing it or not doingit.
  • 22. OOP …Object continue … • In Object Oriented Programming deals with similar objects. • The data of anobject canbe accessed only by the functions associated with that object. • Functions of one object can access the functions of another objects.
  • 23. Organization of data and functions in OOP Data Functions Data Functions Communication Data Functions
  • 24. Basic Concepts of Object-Oriented Programming • Objects • Classes • Data Abstraction and Encapsulation • Inheritance • Polymorphism • Dynamic Binding • Message Passing
  • 25. Objectsin OOP • Object are the basic run-time entities in an object-oriented system. • They may represent aperson, aplace , abank account, a table of data or • Objects take up space in the memory • When aprogram is executed, the objects interact by sending messages to one another
  • 27. If there are two objects customer and account then the customer object may send a message to account object ..requesting for the bank balance. Object : CUSTOMER Object :ACCOUNT Objects example DATA AC No. Name of AC Holder Address FUNCTIONS Deposit Withdrawal AC Balance Display DATA AC No. AC Balance T ype of Account FUNCTIONS Account Balance
  • 28. Classes • A class is user-defined data type which contains data members and member functions...Members function operate those data Members. • Classes are user defined data types and behaves like the built in type of aprogramming language. • Once a class has been defined, we can create any number of objects belonging to that class. Thus a class is collection of objects of similar type. • class is collection of similar kind of objects.
  • 29. OBJECT Classes :The entire set of data & code of an object can be made a user-defined data type with the help of a class.Objects are actually variable of the type class HAS DOES color diameter brand bounce roll properties behavior
  • 30. Classes • A Class is a collection of fields (data) and methods (procedure or function) that operate on that data. • Class are just like the blueprints of objects that model real world things. • one of advantage of using classes is that once you have created a class for acertain type of object you canreuse that class in any project.
  • 31. A class Is defined by 3element 1.A unique class name 2.Data members or attributes 3.Member functions or methods circle centre radius circumference() circumference() area()
  • 36. OBJECT A class describes an object HAS DOES color diameter brand bounce roll properties behavior
  • 37. OBJECT a classdescribes an object Class ball String color; float diameter; String brand; void bounce(float h) void roll (float d) HAS DOES color diameter brand bounce roll properties behavior
  • 38. Circle ball String color; Float diameter; Data members String brand; void bounce(float h) void roll (float d) Members methods
  • 39. The syntax for defining classin c++: class class_name { private : variable declarations; functions declarations; public: variable declarations; functions declarations; }; void main() { class_name variabale_name; …. }
  • 40. The syntax for defining class in java : class class_name { private variable declarations; functions declarations; public variable declarations; functions declarations; } class mainclass_name { public static void main(String args[]) { class_name variabale_name=new class_name( ); …. } }
  • 41. example of class in Java class ball { String color; float diameter; String brand; void bounce(float h) { } void roll (float d) { } } class ballmain { public static void main (String args[ ]) { / /Following statement would create an object ball b=new ball( ); } }
  • 48. Ball b =new Ball(); b.color=“white”; b.diam=2.0f; b.brand=“nike”; b.bounce(); b.boll();
  • 53. Basic Concepts of OOP Data Abstraction and Encapsulation oThe wrapping up of data and functions into a single unit is known as encapsulation. oThe data is not accessible to the outside world, and only those functions which are wrapped in the class can access it. oThese functions provide the interface between the object’s data and the program. This insulation of the data from direct access by the program is called data hiding or information hiding.
  • 54. Data Abstraction & Encapsulation oThe attributes wrapped in the classesare called data members and the functions that operate on these data are called methods or member functions. oSince the classes use the concept of data abstraction, they are known as Abstracted Data Types (ADT).
  • 55. Basic Concepts of OOP Data Abstraction : The concept of abstraction isclosely related to the concept of data or information hiding abstraction separates qualities of data type & the associated implementation detailed. this helps the properties of the abstract data types user interface while the implementation detailed remain hidden.
  • 56. Inheritance o Inheritance is the process by which objects of one class acquire the properties of objects of a c o n n o t i n t u h e e … rclass. o It supports the concept of hierarchical classification. o Inheritance is a compile-time mechanism in Java that allows you to extend a class (called the baseclass or superclass) with another class (called the derived class or subclass) or o The mechanismof deriving a class from another existing class is called as inheritance . o Access specifies:- public, protected ,private, default. 
  • 57. Property Inheritance Bird Attributes: Feathers Lay eggs Flying Bird Non-flying Bird Attributes: ------------ ------------ Attributes: ------------ ------------ Robin Attributes: ------------ ------------ Swallow Attributes: ------------ ------------ Penguin Attributes: ------------ ------------ Kiwi Attributes: ------------ ------------
  • 58. Derived class-base class declaration syntax in Inheritance : class A { …………… …………….. } class B extends A { ………….. …………… } class c extends B { …………… …………… }
  • 59. Inheritance : o Inheritance provides the idea of reusability. oWe can add additional features to an existing class without modifying it. (By deriving new class from existing one. The new class will have the combined features of both the classes.)
  • 60. Basic Concepts of OOP Polymorphism:ability to take more than one form o An operation may exhibit different behaviors in different instances. o The behaviour depends upon the types of data used in the operation. o add( 3, 5) gives 8. o Add(“hello”, “-world”) gives “hello-world”.
  • 61. Polymorphism o ability to take more than one form oThe process of makingan operator to exhibit differen t behaviors in different instances is known as operator overloading. < < Insertion Operator < < Left-shift bit-wise operator oUsing asingle function name to perform different types of tasks is known as function overloading. add( 3, 5) gives 8 Add(“hello”, “-world”) gives “hello-world”
  • 62. Dynamic Binding o Binding refers to the linking of a procedure call to the code to be executed in response to the call. o Dynamic binding (late binding ) means that the code associatedwith agivenprocedure call is not known until the time of the call at run- time.It is associated with polymorphism & inheritance.
  • 63. Message Passing • An oop consists of a set of objects that communicate with each other. • oop involves the following steps: oCreating classes that define objects and theirbehaviour. oCreating objects from class definitions. oEstablishing communication amongobjects. •Objects communicate with one another by sending and receiving information.
  • 64. Basic Concepts of OOP Message Passing o A message for an object is a request for execution of a procedure. o The receiving object will invoke a function and generates results. o Message passing involves : oThe name of the Object. oThe name of the Function. oThe information to be send.
  • 65. Benefits of OOP • Inheritance – eliminate redundant code and extend the use of existing classes. • • We can build programs from the standard working module. secure programs that can not be invade by code in other parts of the program. • Multiple instances of an objects can co-exists with out any interference.
  • 66. Benefits of OOP • It is easy to partition the work in a project based on objects. • Object-oriented system can be easily upgraded from small to large systems. • communication between objects makes the interface descriptions with external systems much simpler. • Software complexity can be easily managed.
  • 67. Characteristics of Object-Oriented Programming • Importance is on data. • Programs are divided into objects. • Objects may communicate with each other through functions. • Data structures are designed such that they • Functions that operate on the data of an object are tied together in the data structure. • Data is hidden and can not be accessed by external functions. • New data and functions can be added easily whenever necessary.
  • 68. Difference Between Procedure Oriented Programming (POP) & Object Oriented Programming (OOP) Procedure Oriented Programming Object Oriented Programming Divided Into In POP, program is divided into small parts called functions. In OOP, program is divided into parts called objects. Importance In POP,Importance is not given to data but to functions as well as sequence of actions to be done. In OOP, Importance is given to the data rather than procedures or functions because it works as real world. Approach POP follows Top Down approach. OOP follows Bottom Up approach.
  • 69. Procedure Oriented Programming Object Oriented Programming Access Specifiers POPdoes not have any access specifier. OOPhas access specifies named Public, Private, Protected, etc. In POP, Data can move freely Data Moving from function to function in the system. In OOP, objects can move and communicate with each other through member functions. Expansion To add new data and function in POPis not so easy. OOPprovides an easy way to add new data and function.
  • 70. Procedure Oriented Programming Object Oriented Programming DataAccess In POP, Most function uses Global data for sharing that can be accessed freely from function to function in the system. In OOP, data can not move easily from function to function,it can be kept public or private so we can control the access of data. POPdoes not have any proper OOPprovides Data Hiding Data Hiding way for hiding data so it is less secure. so provides more security. Overloading In POP, Overloading is not possible. In OOP, overloading is possible in the form of Function Overloading and Operator Overloading. Examples Example of POPare : C, VB, FORTRAN, Pascal. Example of OOPare : C++, JAVA, VB.NET, C#.NET.