Object-oriented programming (OOP) is a programming style based on data structures that contain data in fields, which are commonly called attributes. There is also code in the form of procedures, which are commonly called methods. This combination of a data structure and code is called a class. An object is a particular instantiation of a class. All interaction with the data in an object and the program that created the object is controlled through the object’s methods.
Many explanations and definitions of OOP try to clarify the concept with a concrete example, such as a dog: