OOPs concepts in C++ | object oriented programming in c++ | My CS tutorial - My CS Tutorial

Breaking

Programming languages full tutorial and programs, exam papers, visual basic( Vb.net ), information of new technologies and more....

Wednesday, July 15, 2020

OOPs concepts in C++ | object oriented programming in c++ | My CS tutorial

Concepts of OOPs in C++ | OOPs concepts in c++ programming | object oriented programming in c++ | My CS Tutorial


Object oriented programming is a way of solving complex problems by breaking them into smaller problems using objects. In object oriented programming, main focus is objects.

Concepts of OOPs in C++ | My CS Tutorial


Before Object Oriented Programming (commonly referred as OOP), programs were written in structuted or procedural language, they were nothing but a long list of instructions. On the other hand, the OOP is all about creating objects that can interact with each other, this makes it easier to develop programs in OOP as we can understand the relationship between them.


CONCEPTS OF OOPs:-

In object oriented programming (OOPs) some concept are available which are {objects, classes,polymorphism, data abstraction and data encapsulation and inheritance}.

(i) OBJECTS:-


objects are basic run time entity in an object oriented system. Object is an identifiable entity with some characteristics and behaviour.
        They may represent a person,place, a bank account and the table of data on any item that the program has to handle. Programming problem is analysis in term of objects and nature of communication between them. Many program is executed the objects interacts by sending message to one another.


(ii) CLASSES:-


A class is a group of objects that share a common property and relationship.Once a class has been defined we can create any number of objects belonging to that class A class is does the collection of similar type of objects. The entire set of data and function of an object is a user defined data type with the help of class. So the object are the variable of the type class. Each object is associated the data in which they are created. A class is a collection of object of similar type.

example:-

apple,banana and orange are object of belonging class fruit. the syntax of class are given below:-

class_name  object_name;

example:-

fruit apple;.


(iii) POLYMORPHISM:-


polymorphism is one of the most principle of object oriented programming polymorphism means one name to different form. Polymorphism is the ability for a data to be processed in more than one form. Polymorphism that the same function name may behave differently and different class. The process of making an operator to exhibit different behaviour and different instant is known as operator overloading.


(iv) DATA ABSTRACTION AND DATA ENCAPSULATION:-


(a) Abstraction:-


Data Abstraction is a act to represent the essential feature of an object without including background and explanation. The data Abstraction is a future to provide the access of member data without show the hidden data. classes use the concept of abstraction and defined as abstract attributes(Data) such as size, weight and cost etc, and function to operate on these attributes are called member data and function to operate these data are called Member function. Classes used the concept of Abstraction.


(b) Encapsulation:-


Encapsulation is a fundamental concept of object oriented programming. It is a way of combining the data and function into a single unit is called class and this mechanism is called encapsulation. This property provides the feature of information (Data) Hiding.

(v) INHERITANCE:-


Inheritance is a process by which object of one class required the property of an object of another class. It support the concept of hierarchical classification. Inheritance is a mechanism of sharing data and operations(functions) among the classes.



_______________________________________


Please share this post and blog link with your friends.For more programs use this blog.

If you have any problem, please comment in comment box, subscribe this blog for notifications of new post on your email and follow this blog.If you have any method of this tutorial or program or want to give any suggestion send email on hc78326@gmail.com

Created by-- HARSH CHAUHAN

No comments:

Post a Comment