OOP Concepts in C++





  • C++ is a multi-paradigm programming language. Means, it supports different programming styles.

  • One of the popular ways to solve a programming problem is by creating objects, known as object-oriented style of programming.

  • C++ supports object-oriented (OO) style of programming.

  • As the name object-oriented programming suggests, this approach deals with objects.

  • In object-oriented programming language, the data and methods (functions) are bundled together as self-contained unit called an object.

    A class is an extended concept similar to the structure in C programming language. In C++ programming language, class describes both the properties (data) and behaviors (methods) of objects.

  • In this chapter, we will learn about basics of OOPs. Object Oriented Programming is a paradigm ( style, pattern ) that provides many concepts such as inheritance, encapsulation, polymorphism etc.


The key ideas of OOP approach are :

  • Object
  • Class

The key concepts of OOP approach are :

  • Encapsulation
  • Abstraction
  • Inheritance
  • Polymorphism

Object :

Any entity that has state and behavior is known as an object. For example: keyboard,laptop, bike etc. It can be physical and logical.


Class :

Collection of objects is called class. It is a logical entity.


Encapsulation :

Encapsulation is the mechanism that binds together code and the data it manipulates, and keeps both safe from outside interference and misuse. One way to think about encapsulation is as a protective wrapper that prevents the code and data from being arbitrarily accessed by other code defined outside the wrapper/class.


Inheritance :

Inheritance is the process by which one object acquires the properties of another object. This is important because it supports the concept of hierarchical classification. Without the use of hierarchies, each object would need to define all of its characteristics explicitly. However, by use of inheritance, an object need only define those qualities that make it unique within its class. It can inherit its general attributes from its parent.


Polymorphism :

Polymorphism (from the Greek, meaning "many forms") is a feature that allows one interface to be used for a general class of actions. The specific action is determined by the exact nature of the situation. Polymorphism is a way by which an object can exhibit multiple behaviour in multiple instances or situations.


Next topic is Class and Objects





 




Training For College Campus

We offers college campus training for all streams like CS, IT, ECE, Mechanical, Civil etc. on different technologies like
C, C++, Data Structure, Core Java, Advance Java, Struts Framework, Hibernate, Python, Android, Big-Data, Ebedded & Robotics etc.

Please mail your requirement at info@prowessapps.in


Projects For Students

Students can contact us for their projects on different technologies Core Java, Advance Java, Android etc.

Students can mail requirement at info@prowessapps.in


CONTACT DETAILS

info@prowessapps.in
(8AM to 10PM):

+91-9026070669 , +91-9451396824

© 2016, prowessapps.in, All rights reserved