There are two common programming methods: procedural programming and object-oriented programming (OOP). So far you have been creating procedural programs.
In a procedural program data is typically stored in a collection of variables and there is a set of functions that perform operations on the data. The data and the functions are separate entities. Usually the variables are passed to the functions that perform the desired operations. As you might imagine, the focus of procedural programming is on creating the functions, or procedures, that operate on the program’s data. Procedural programming works well. However, as programs become larger and more complex, the separation of a program’s data and the code that operates on the data can lead to problems.
Object Oriented programming
The object oriented programming design models the real world well and overcomes the shortcomings of procedural paradigm. It views a problem in terms of objects and thus emphasizes on both procedures as well as data.
An object is an entity that combines both data and procedures in a single unit. An object’s data items, also referred to as its attributes, are stored in member variables. The procedures that an object performs are called its member functions. This wrapping of an object’s data and procedures together is called encapsulation.
Not only objects encapsulate associated data and procedures, they also permit data hiding. Data hiding refers to an object’s ability to hide its data from code outside the object. Only the object’s member functions can directly access and make changes to the object’s data.
Advantages of Object oriented programming.
Software complexity can be easily managed
Object-oriented systems can be easily upgraded
It is quite easy to partition the work in a project based on object