Object Oriented Programming | What Is OOPS In Java?
Author: Zeba Ali
What is object-oriented programming?
Object Oriented Programming is a methodology or paradigm in Java to design a program using class and object. It simplifies software development and maintenance by providing concept such as object, class, inheritance, Polymorphism, Abstraction , Encapsulation.
How Object Oriented Programming is related to real world?
To solve the problems of the real world , we do coding. Based on an object, in OOP, we write a logic, with features such as abstraction, polymorphism, inheritance , encapsulation. There are a lot of known objects such as a car, machine , bike, ATM, etc. Classes help in creating Object logic, for example with a phone we can call , use Bluetooth , take pictures etc. These all functions divide as classes, when we are creating classes we need consider solid various principles such as:
Abstraction
when we are making a call, it only concentrates on the number end display that end screen, we really do not know how this connect with other number .
Encapsulation
when we turn on the Bluetooth we can connect with other devices. We can assess to connect to other phones. But from that phone we cannot assess to call or send SMS, encapsulation hides that level.
Polymorphism
When we turn on the phone by one button the same time we can turn it off by the same button.
Why we need OOP in programming language?
- Duplicate code is bad.
- Code will always be changed.
Limitation of oops
1- Improved software development productivity: OO programming is modular, as it provides separation of duties in object-based program development. It is also extensible and objects may extend to include new attributes and behaviors. We can reuse objects within an across applications. Because of these three factors; extensibility, modularity, and reusability.
2- Faster development: Reuse enables faster development. Object-oriented programming languages come with rich libraries of objects, and code developed during projects is also reusable in future projects.
3- Lower cost of development: The reuse of software also lowers the cost of development. Typically, more we have to put into the OO analysis and design, which lowers the overall cost of development.
4- Higher-quality software: Faster development of software and lower cost of development allows more time and resources to be used in the verification of the software. Although quality is dependent upon the experience of the teams, OO programming tends to result in higher-quality software
Disadvantages of oop
1- Steep learning curve: The thought process involved in OO programming may not be natural for some people, and it will take the time to get used to it.
2- The complexity of creating programs: it is very complex to create programs based on the interaction of objects. Some of the key programming techniques, such as inheritance and polymorphism, can be a big challenging to comprehend initially.
Why is X language object Oriented? what does it mean?
Oops is a computer programming model that organize software design around data , or object rather than function and logic. OOP focus on object that developer want to manipulate rather than the logic required to manipulate them .
Java use OOP language as java use classes and object but java is not pure OOP language as java support non-primitive data type like int, float etc.
X language needs to satisfy 7 qualities:-
- Encapsulation
- Inheritance
- Abstraction
- Polymorphism
- All predefined types are object
- All user defined are object
- each and every operation performed on object must only through method exposed at object.
Java only support 1,2,3,4 and 6 but fails to support property 5 and 7 given above. Java language contains certain properties because of which it is not a pure language. These are :
Primitive Data Type ex. int, long, bool, float, char, etc as Objects: Smalltalk is a ‘pure’ object-oriented programming language unlike Java and C++ as there is no difference between values which are objects and values which are primitive types. In Smalltalk, primitive values such as integers, Booleans and characters are also objects.
In Java, we have predefined types as non-objects (primitive types).
Read Similar Types :
Mail us at edumoundofficial@gmail.com