Tutorials
C++
Elements of Object Oriented Programming
Elements of Object Oriented Programming - Page 2Elements of Object Oriented Programming
Object-Oriented Programming is centered around the new concepts such as classes, polymorphism, inheritance, etc. it is a well suited paradigm for the following:
Definition of OOP:
OOP uses objects as its fundamental building blocks. Each object is an instance of some class. Classes allow the mechanism of data abstraction for creating new data types. Inheritance allows building of new classes from existing classes. Hence if any of these elements are missing in a program we cannot consider that program as objected oriented program.
Object oriented programming is a programming methodology that associates data structures with a set of operators which act upon it. In OOP’s terminology an instance of such an entity is known as an object. It gives importance to relationships between objects rather than implementation details. Hiding the implementation details within an object results in the user being more concerned with an objects relationship to the rest of the system, than the implementation of the object’s behavior.
Objects:
Objects are the basic run-time entities in an object-oriented system. Every object is associated with data and functions which define meaningful operations on that object.
What is Encapsulation
It is a mechanism that associates the code and the data it manipulates into a single unit to and keeps them safe from external interference and misuse. In C++ this is supported by construct called class. An instance of an object is known as object which represents a real world entity.
What is Data Abstraction
A data abstraction is a simplified view of an object that includes only features one is interested in while hides away the unnecessary details. In programming languages, a data abstraction becomes an abstract data type or a user-defined type. In OOP, it is implemented as a class.