OOP2
OOP2
(OOPs)
● Objectoriented programming
aims to implement realworld
entities like inheritance,
hiding, polymorphism, etc in
programming
● The main aim of OOP is to
bind together the data and
the functions that operate on
them so that no other part of
the code can access this data
except that function
Procedure OR Object Oriented?
Importance is not given to data but to functions Importance is given to the data rather than
as well as sequence of actions to be done. procedures or functions because it works as a
real world.
It does not have any access specifier. OOP has access specifiers named Public,
Private, Protected, etc.
Data can move freely from function to function objects can move and communicate with each
in the system. other through member functions.
Procedure OR Object Oriented?
Procedure Oriented Programming Object Oriented Programming
To add new data and function in POP is not OOP provides an easy way to add new data and
so easy. function.
Most function uses Global data for sharing In OOP, data can not move easily from
that can be accessed freely from function to function to function,it can be kept public or
function in the system. private so we can control the access of data.
It does not have any proper way for hiding OOP provides Data Hiding so provides more
data so it is less secure. security
#include <iostream>
int main()
{
cout << "Hello World" << endl;
return 0;
}