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 object
is called classdoes not consume any space
Inheritance
provides code
re-usability
used to achieve runtime
polymorphism
Polymorphism
If one task is performed in different ways, it is known as polymorphism
In Java, we use
method overloading
andmethod overriding
to achieve polymorphism
Abstraction
Hiding internal details
andshowing functionality
is know as abstractionIn Java, we use
abstract class
and interlace to achieve abstraction
Encapsulation
Binding (or wrapping) code and data together into a single unit are known as encapsulation
A
Java class
is the example of encapsulationJava bean
is the fully encapsulated class since all the data members are private here
Last updated