Object Oriented Concepts

Object Oriented Concepts

Before we go into detail, let’s define important terms related to Object Oriented Programming and Object Oriented Concepts

  • Class − This is a programmer-defined data type, which includes local functions as well as local data. You can think of a class as a template for making many instances of the same kind (or class) of the object.
  • Object − An individual instance of the data structure defined by a class. You define a class once and then make many objects that belong to it. Objects are also known as instances.
  • Member Variable − These are the variables defined inside a class. This data will be invisible to the outside of the class and can be accessed via member functions. These variables are called attributes of the object once an object is created.
  • Member function − These are the function defined inside a class and are used to access object data.
  • Inheritance − When a class is defined by inheriting the existing function of a parent class then it is called inheritance. Here child class will inherit all or a few member functions and variables of a parent class.
  • Parent class − A class that is inherited from another class. This is also called a base class or superclass.
  • Child Class − A class that inherits from another class. This is also called a subclass or derived class.
  • Polymorphism − This is an object-oriented concept where the same function can be used for different purposes. For example, the function name will remain the same but it makes take a different number of arguments and can do different tasks.
  • Overloading − a type of polymorphism in which some or all operators have different implementations depending on the types of their arguments. Similarly, functions can also be overloaded with different implementations.
  • Data Abstraction − Any representation of data in which the implementation details are hidden (abstracted).
  • Encapsulation − refers to a concept where we encapsulate all the data and member functions together to form an object.
  • Constructor − refers to a special type of function that will be called automatically whenever there is an object formation from a class.
  • Destructor − refers to a special type of function that will be called automatically whenever an object is deleted or goes out of scope.
0 0 votes
Article Rating
Subscribe
Notify of
guest
0 Comments
Inline Feedbacks
View all comments