- OOP stands for Object-Oriented Programming.
- Procedural programming is about writing procedures or methods that perform operations on the data, while object-oriented programming is about creating objects that contain both data and methods.
Object-oriented programming has several advantages over procedural programming:
OOP is faster and easier to execute
OOP provides a clear structure for the programs
OOP helps to keep the Java code DRY "Don't Repeat Yourself", and makes the code easier to maintain, modify and debug
OOP makes it possible to create full reusable applications with less code and shorter development time
It simplifies software development and maintenance by providing some OOPs Concepts in Java:
Object
Class
Inheritance
Polymorphism
Abstraction
Encapsulation
Objects are always called instances of a class which are created from a class in java or any other language. They have states and behaviour.
Classes are like object constructors for creating objects. The collection of objects is said to be a class.
Inheritance in Java is a mechanism in which one object acquires all the properties and behaviors of a parent object. Inheritance also supports hierarchical classification.
There are five types of inheritance
- Single
- Multilevel
- Multiple
- Hybrid and
- Hierarchical
Polymorphism refers to many forms, or it is a process that performs a single action in different ways. It occurs when we have many classes related to each other by inheritance.
Polymorphism in java can be classified into two types:
- Static / Compile-Time Polymorphism
- Dynamic / Runtime Polymorphism
Abstraction is a process which displays only the information needed and hides the unnecessary information. We can say that the main purpose of abstraction is data hiding.
Encapsulation is one of the concepts in OOPs concepts; it is the process that binds together the data and code into a single unit and keeps both from being safe from outside interference and misuse.
- @ Author Name: MD SAIF UDDIN
- @ Author Email: saifcsediu806@gmail.com