Professional Documents
Culture Documents
Code : 05201201
MCA [ Semester-I ]
Faculty of IT & Compute Science
PARUL UNIVERSITY
Introduction to Java
UNIT-1 [Datatypes, Operators, Statements]
Lecture – 2
• OOP Approach
• Concepts of OOP - classes and objects, abstraction and
encapsulation,inheritance, polymorphism, Dynamic Binding.
• Comparison of OO and procedure oriented approaches
Basic Concept of OO Approach
• Feature of OO paradigm are:
• Focus on Data rather than procedure.
• Programs are divided into objects.
• Designed data structures to characterize the objects.
e.g.: Classes
• Data and related methods are tied together in the class.
• Data is hidden and can’t be accesses by external
functions.
• Objects can communicate via methods.
• New data and methods can be easily added whenever
necessary.
• Follows bottom-up approach in program design.
Comparison of OO and procedure oriented
approaches:
Procedure Oriented Object Oriented
Programming Programming
Divided Into In POP, program is divided into In OOP, program is
small parts called functions. divided into parts called
objects.
Importance In POP, Importance is not given In OOP, Importance is
to data but to functions as well given to the data rather
as sequence of actions to be than procedures or
done. functions because it
works as a real world.
Access POP does not have any access OOP has access
specifier. specifiers named Public,
Specifiers
Private, Protected, etc.
Data Moving In POP, Data can move freely In OOP, objects can move and
from function to function in the communicate with each other
system. through member functions.
Expansion To add new data and function OOP provides an easy way to
in POP is not so easy. add new data and function.
Data Access In POP, Most function uses In OOP, data can not move
Global data for sharing that can easily from function to
be accessed freely from function, it can be kept public
function to function in the or private so we can control the
system. access of data.
Data Hiding POP does not have any proper OOP provides Data Hiding so
way for hiding data so it is less provides more security.
secure.