Object-oriented programming is a programming concept that is based on objects. An object is a collection of related data such as fields and procedures, that is, methods. For example, an object could be anything right from a very simple object such as a pencil to a very complex type such as a car. Each object will have its own set of attributes, that is, properties and functions or the methods that are implemented in that object. For example, for a car object, the possible attributes could be color, registration number, model, and so on. The possible functions could be start, stop, and accelerate.
Before object-oriented programming came into the picture, we did our programming under the principles of procedural programming. In a procedural language, an application was divided into a set of functions. The data that was used in the program...