Java OOPs
Java is object-oriented programming language. It is a pattern and provides many concepts such as data binding, inheritance, polymorphism, encapsulation, and etc.
In this everything is represented as an object is known as an object-oriented programming language.
The object in Java language matches a real-world entity such as a dog, chair, table etc. It is a methodology to design a program using the objects and the classes.
In OOPs, we mainly concentrate on the classes and objects.
There are 6 major concept in OOPs:-
- Object
- Class
- Polymorphism
- Inheritance
- Abstraction
- Encapsulation


Object
The object in Java language matches a real-world entity. Objects having state and behavior.
Example: Dog having eyes and 4 legs but the behavior is barking.
Class
The class is a blueprint of an object. Collection of objects is known as class. It is a logical entity.


Inheritance
Acquire the properties and behavior of parent class to subclass is known as the Inheritance. It provides reusability of code and used to achieve runtime polymorphism.
Example: Teacher is a parent class and students acquires all the properties of the teachers.
Polymorphism
Single action is performed by different ways i.e., known as the polymorphism.
Polymorphism means having many forms.
Example: Ben ten can transform into different ways such as aliens.


Abstraction
Hiding the details of the object and showing the functionality is called as an abstraction.
Example: Phone call, we do not know the internal processing.
Encapsulation
Wrapping up of data and code together into a single unit is called encapsulation.
Example: Capsule, it is wrapped with different medicines.

Advantages of OOPs:
- It is easily adapted and modified by the programmer.
- Object-oriented programming languages contain rich libraries of objects. It enables faster development.
- Objects can also be reused within across applications.
- It is a clear modular structure for programs.
- It makes software easier to maintain.
Quickly Find What You Are Looking For
Onlinetpoint is optimized for basic learning, practice and more. Examples are well checked and working examples available on this website but we can't give assurity for 100% correctness of all the content. This site under copyright content belongs to Onlinetpoint. You agree to have read and accepted our terms of use, cookie and privacy policy.