OOP
Aim of object-oriented Programming
: to implement real-word entities, for example, object, classes, abstraction, inheritance, polymorphism, etc.
OOPs (Object-Oriented Programming System)
Object means a real-world entity, and OOP is a methodology or paradigm to design a program using classes and object.
Object
any entity that has state and behavior is know as an object
can be defined as an instance of a class
can communicate without knowing the details of each other's data or code
-> the only necessary thing is the type of message accepted and the type of response returned by the objects
Class
collections of objectis called classdoes not consume any space
Inheritance
provides code
re-usabilityused to achieve runtime
polymorphism
Polymorphism
If one task is performed in different ways, it is known as polymorphism
In Java, we use
method overloadingandmethod overridingto achieve polymorphism
Abstraction
Hiding internal detailsandshowing functionalityis know as abstractionIn Java, we use
abstract classand interlace to achieve abstraction
Encapsulation
Binding (or wrapping) code and data together into a single unit are known as encapsulation
A
Java classis the example of encapsulationJava beanis the fully encapsulated class since all the data members are private here
Last updated