Welcome to Let us programming guys.This is our first post introducing you to Object Oriented Programming well known as OOP. Here we are going to teach you about Object Oriented Programming and explain the concepts and advantages of using OOP’s over Structural Programming. In your today’s post we shall know the features of OOP’s and advantages of OOP’s.
The main features of OOP’s are:
1.Class
2.Data Encapsulation
3.Data Abstraction
4.Object and Instances
5.Inheritance
6.Polymorphism
Now we shall go in detail about each of the features.
1.Class: In OOP language we define classes as that of structures in C programming.But the additional features of classes is we add member functions in classes.The variables which are used to store the values are called as data members and the functions which are used operate on these data members are called as member functions.Classes are only the logical representation of the data members so they will not occupy any memory space and only data members occupy memory.
2.Data Encapsulation: We know that classes contain both data members and member functions. Writing both these in a single class is called as Data Encapsulation.
3.Data Abstraction: Before learning about it we shall know that a members whether data members or member functions can be either public or private.If we specify any member as public we can access these members in any other functions. If we specify as private we can’t access members outside of the class.This feature of OOP is called as Data Abstraction.
4.Object and Instances:As we have specified earlier that classes are only the logical representation of the data.Therefore to store the data in the class variables we need objects.The memory to the variables is allocated from the heap when we use objects.
5.Inheritance: The main theme of inheritance feature is the re-usability of the existing code. If we want to use same data members as that off in the old class we can use reuse those data members from the existing one through inheritance.
6.Polymorphism: Polymorphism mean having more than two forms.Polymorphism is of two types compile-time and run-time polymorphism.
These are the features of Object Oriented Programming. Let us see the advantages of Object Oriented Programming.
The main advantages of Object Oriented programming are:
1.Simplicity
2.Modularity
3.Modifiability
4.Extensibility
5.Maintainability
6.Re-Usability
Code reusability in terms of inheritance. Object oriented system can be simply upgraded from one stage to another. Complex project can be divided into small code function. Rapid development of software can be done in short time. Software complexity reduces. Principle of observation and encapsulation enables a programmer to build secure programmes. Data hiding helps programmer to design and develop safe programme. More than one instance of same class can exist together without may interface.
Pingback: Structure of C++ program | letusprogram….!!!