C++ is the type of Object-Oriented Programming

Last Updated :

OOP stands for Object-Oriented Programming.

Procedural programming is about writing procedures or functions that perform operations on the data, while object-oriented programming is about creating objects that contain both data and functions. Object oriented programming languages are various but the most popular ones are class-based.

Languages used in Procedural Programming:

FORTRAN, ALGOL, COBOL, 
BASIC, Pascal and C. 

Languages used in Object Oriented Programming:

Java, C++, C#, Python, 
PHP, JavaScript, Ruby, Perl, 
Objective-C, Dart, Swift, Scala.  

Example of simple procedural :

var a,b; 
function getSum(){ 
	return a+b; 
} 

Example of object oriented language:

class sum{ 
	private var a,b; 
	function getSum(){ 
		return a+b; 
	} 
} 

Object-oriented programming has several advantages over procedural programming:

  • OOP provides a clear structure for the programs
  • Program is divided into small parts called objects.
  • Improved software-development productivity
  • Improved software maintainability
  • Lower cost of development
  • OOP is faster and easier to execute
  • OOP follows bottom up approach intead of top down approach
  • OOP is based on real world
  • Adding new data and function is easy.
  • OOP has have access specifiers like private, public, protected etc.
  • OOP has concept of data hiding, Overloading, Encapsulation, polymorphism, Inheritance, abstract class.
  • OOP also has Reusability, dynamic nature ,inter communication within the blocks, multithreading, etc which are missing in procedural language.

What are Classes and Objects ?
There are two two main aspects of object-oriented programming, these are Class and object. The class is a template for the object, and the object is an instance of the class.

Example-1:

Example-2:



Please write comments if you find anything incorrect. A gentle request to share this topic on your social media profile.

Comment
Next Article
CPP_Programmer Published 08 Aug, 2020 · 2 min read
Article Tags :

Similar Reads

  • Four Pillars of Object-Oriented Programming (OOPS)

    Get an overview of four pillars of object-oriented programming (OOP) and see their suitable real life examples. What is OOP? Picture a cluttered garage🛠️. Tools are scattered everywhere,…

    4 min read
  • What is Overriding in C++

    Write a program in C++ to depict the concept of overriding or Dynamic polymorphism. Overriding is a type of polymorphism. Polymorphism in OOP languages means to take more…

    2 min read
  • What should we use void main() or int main() ?

    There is question that what should we use void main() or int main() ? void main() { /* ... */ } Or, int main() { /* ... */…

    2 min read
  • C Comments

    Prerequisite – C Language Introduction C comments explain code and improve readability. These do not affect program execution. You can use comments in C to clarify code and describe…

    1 min read
  • What is Object-Oriented Programming

    OOPs stands for Object Oriented Programming. OOP is a programming style with Classes, Objects, Inheritance, Polymorphism, Encapsulation, Abstraction. Before OOP, Procedural Programming like C was used, based on…

    2 min read
  • Code editors

    Code editors are where programmers spend most of their time. There are two main types of code editors: IDEs and Lightweight editors. IDEs (Integrated Development Environments) IDEs (Integrated…

    1 min read