Object Oriented Programming:
Object Oriented Programming (OOP) is a programming concept which used in the modern programming world. Languages like Java, C++, and Python support Object Oriented Programming (OOP). It works on the principle that objects are the most important part of a program. In OOP we think in terms of objects and every object has its attributes (properties) and a state (behavior/functions).Object Oriented Programming (OOP) is a technique of system modeling and its main purpose is to understand the product before developing it and manipulating these objects to achieve a specific task.
Pillars of Object Oriented Language (OOP):
There are four basic principles of Object Oriented Language (OOP).- Inheritance
- Polymorphism
- Data Encapsulation
- Abstraction
WHY is Object Oriented Language (OOP) NEEDED?
Problems with Procedural Languages:
- Functions have unrestricted access to global data
- Unrelated Functions and data.
Before Object Oriented Programming programs were viewed as procedures that accepted data and produced an output. There was little emphasis given to the data that went into those programs.
Advantages of Object Oriented Language (OOP):
- Data Secure: data is hidden from outside world.
- Code Reusability: Reusability is one of its main features.
- Flexibility: code can be easily changed.
Difference Between Procedure and Object Oriented Programming Language:
Procedure Oriented Programming | Object Oriented Programming |
Programs are divided into small parts called functions. | Program is divided into parts called objects. |
Functions are given more importance than data. | Importance is given to the data rather than procedures or functions because it works as a real world. |
Data can move freely from function to function in the system. | Objects can interact with each other through member functions to achieve a specific task. |
To add new data and function is not so easy. Most function uses Global data for sharing that can be accessed freely from function to function in the system. | OOP provides an easy way to add new data and function. In OOP, we can keep data public or private to control the access of data. |
Procedure language does not have any way to hide data. | OOP provides Data Hiding so provides more security. |
Examples are C, VB, FORTRAN, Pascal. | Examples are C++, JAVA, VB.NET, C#.NET. |
Comments
Post a Comment