Basic Elements of OOPs
There are Eight basic elements in Object oriented Language.
- Data Abstraction
- Data Hiding
- Dynamic Binding
Any entity that has state and behavior is known as an object.They are the basic elements of object Oriented system For example: chair, pen, table, keyboard, bike etc. It can be physical and logical.
Collection of objects is called class. It is a logical entity.class is a group of objects,which posses same attributes and behavior.
Hiding internal details and showing functionality is known as abstraction. For example: phone call, we don’t know the internal processing.
In java, we use abstract class and interface to achieve abstraction.
Binding (or wrapping) code and data together into a single unit is known as encapsulation. For example: capsule, it is wrapped with different medicines.A java class is the example of encapsulation. Java bean is the fully encapsulated class because all the data members are private here.
5. Data Hidding:
When one object acquires all the properties and behaviors of parent object i.e. known as inheritance. It provides code re usability. It is used to achieve run time polymorphism.
When one task is performed by different ways i.e. known as polymorphism. For example: to convense the customer differently, to draw something e.g. shape or rectangle etc.
In java, we use method overloading and method overriding to achieve polymorphism.
Another example can be to speak something e.g. cat speaks mew, dog barks woof etc.
8. Dynamic Binding:
Static and Dynamic Bindinding in Java
Binding: Connecting a method call to the method body is known as binding.There are two types ...read more
Polymorphism in Java
Polymorphism in java is a concept by which we can perform a single action by ...read more
Encapsulation in Java
Encapsulation is grouping of the properties and methods within a class. Providing access to an object ...read more
Abstraction in Java
Abstraction is a process to hiding the implementation details and only showing the functionality to ...read more
Class in Java
Class Class represents a group of similar objects. The class binds the data, describe the entity ...read more
What is OOPs?
Object Oriented Programming (OOP) OOPs is an approach to standardize the programs by creating partitioned memory ...read more