Difference between procedural and object-oriented programming language.
Procedural Language Object-oriented Language
It is a programming language that is derived It’s design philosophy or methodology that
from structure programming and based upon organizes model software design around data
the calling procedure. or objects rather than functions and logic.
Data hiding is possible in OOPs due to
It is less secure than OOPs.
abstraction. Hence, more secure.
It follows a top-down approach. It follows a bottom-up approach.
Here, data moves freely within the system Objects can move and communicate with
from one function to another. each other via member functions.
The access specifiers in OOPs are named as
There are no access specifiers.
public, private and protected.
Procedural programming doesn’t have
There is a feature of inheritance.
concept of inheritance.
There is no code reusability present in Using the concept of inheritance, codes can
procedural programming. be reused several times.
Function overloading & operator
Concept of overloading is not defined.
overloading is possible.
It gives importance to functions over data. It gives importance to data over functions.
Example: C++, Java, Python, C#, .Net, &
Example: C, Fortran, Pascal & VB.
VB.Net.
Characteristics of OOPs:
OOPs has following characteristics: -
• Class: - In OOPs, a class is a blueprint for creating objects providing initial values for
state, and implementations of behavior. Class is a user defined data type. The user-
defined objects are created using the “Class” keyword. Classes are used to create and
manage new objects and support inheritance.
• Objects: - Object is an instance of a class. An object in OOPs is nothing but a self-
contained component which consists of method and properties to make a particular type
of data useful. For example, color name, table tag, barking. When you send message to
an object, you are asking the object to invoke or execute one of its methods as defined
in the class. From a programming point of view, an object in OOPs can include a data
structure, a variable, or a function.
• Data Abstraction: - It is the concept of OOPs that “shows” only essential attributes
and “hides” unnecessary information. The amin purpose of abstraction is hiding the
unnecessary details from users. Abstraction is selecting data from a larger pool to show
only relevant details like of the object to the user. It helps in reducing the programming
complexity and efforts. It is one of the most important concepts of OOPs.
1|Page
, • Polymorphism: - It is one of the core concepts of OOPs and describes situation in
which something occurs in several different forms. In computer science, it describes the
concept that you can access objects of different types through the same interface. Each
type can provide its own independent implementation of this interface. To know
whether an object is polymorphic, you can perform a simple test. If the object
successfully passes multiple is a or instances of tests, it’s polymorphic.
• Encapsulation: - In OOPs encapsulation refers to the bounding of data with the
methods that operate on that data, or restricting of direct access to same of an object’s
components. Encapsulation is used to hide the values or stat of a structured data object
inside a class, preventing direct access to them by clients in a way that could expose
hidden implementation details or violate state invariance maintained by methods.
• Inheritance: - It is the procedure in which one class inherits the attributes and
methods of another class. The class whose properties and methods are inherited is
known as parent class. The class that inherits the properties from the parent class is
called the child class.
• Dynamic Bounding: - It refers to linking a procedure to call to code that will execute
only once. The code association with the procedure is not known until the program is
executed, which is known as late bounding.
• Message passing is nothing but sending and receiving of information by the objects
same as people exchange information. Therefore, this helps in building systems that
simulate real life. Message passing involvers specifying member name of objects, the
name of function and the information to be sent.
Syntax and Data Type of C++.
#include<iostream.h>
#include<conio.h>
class abc
{
public:
void put()
{
cout<<”Hi, This is my first C++ Program.”;
}
};
// End of class.
2|Page
Procedural Language Object-oriented Language
It is a programming language that is derived It’s design philosophy or methodology that
from structure programming and based upon organizes model software design around data
the calling procedure. or objects rather than functions and logic.
Data hiding is possible in OOPs due to
It is less secure than OOPs.
abstraction. Hence, more secure.
It follows a top-down approach. It follows a bottom-up approach.
Here, data moves freely within the system Objects can move and communicate with
from one function to another. each other via member functions.
The access specifiers in OOPs are named as
There are no access specifiers.
public, private and protected.
Procedural programming doesn’t have
There is a feature of inheritance.
concept of inheritance.
There is no code reusability present in Using the concept of inheritance, codes can
procedural programming. be reused several times.
Function overloading & operator
Concept of overloading is not defined.
overloading is possible.
It gives importance to functions over data. It gives importance to data over functions.
Example: C++, Java, Python, C#, .Net, &
Example: C, Fortran, Pascal & VB.
VB.Net.
Characteristics of OOPs:
OOPs has following characteristics: -
• Class: - In OOPs, a class is a blueprint for creating objects providing initial values for
state, and implementations of behavior. Class is a user defined data type. The user-
defined objects are created using the “Class” keyword. Classes are used to create and
manage new objects and support inheritance.
• Objects: - Object is an instance of a class. An object in OOPs is nothing but a self-
contained component which consists of method and properties to make a particular type
of data useful. For example, color name, table tag, barking. When you send message to
an object, you are asking the object to invoke or execute one of its methods as defined
in the class. From a programming point of view, an object in OOPs can include a data
structure, a variable, or a function.
• Data Abstraction: - It is the concept of OOPs that “shows” only essential attributes
and “hides” unnecessary information. The amin purpose of abstraction is hiding the
unnecessary details from users. Abstraction is selecting data from a larger pool to show
only relevant details like of the object to the user. It helps in reducing the programming
complexity and efforts. It is one of the most important concepts of OOPs.
1|Page
, • Polymorphism: - It is one of the core concepts of OOPs and describes situation in
which something occurs in several different forms. In computer science, it describes the
concept that you can access objects of different types through the same interface. Each
type can provide its own independent implementation of this interface. To know
whether an object is polymorphic, you can perform a simple test. If the object
successfully passes multiple is a or instances of tests, it’s polymorphic.
• Encapsulation: - In OOPs encapsulation refers to the bounding of data with the
methods that operate on that data, or restricting of direct access to same of an object’s
components. Encapsulation is used to hide the values or stat of a structured data object
inside a class, preventing direct access to them by clients in a way that could expose
hidden implementation details or violate state invariance maintained by methods.
• Inheritance: - It is the procedure in which one class inherits the attributes and
methods of another class. The class whose properties and methods are inherited is
known as parent class. The class that inherits the properties from the parent class is
called the child class.
• Dynamic Bounding: - It refers to linking a procedure to call to code that will execute
only once. The code association with the procedure is not known until the program is
executed, which is known as late bounding.
• Message passing is nothing but sending and receiving of information by the objects
same as people exchange information. Therefore, this helps in building systems that
simulate real life. Message passing involvers specifying member name of objects, the
name of function and the information to be sent.
Syntax and Data Type of C++.
#include<iostream.h>
#include<conio.h>
class abc
{
public:
void put()
{
cout<<”Hi, This is my first C++ Program.”;
}
};
// End of class.
2|Page