Abstraction is a process to hiding the implementation details and only showing the functionality to the user.Abstraction lets you focus on what the object does instead of how it does it. According to this concept user can fetch the data from the class which is relevant to their application without knowing how they will operate.
for example when we drive the car then only we know that how we drive the car .There is no need to know to how the engine of the car is working.
Ways to achieve Abstraction
There are two ways to achieve abstraction in java
- Abstract class
Abstract class in Java
A class that is declared as abstract is known as abstract class. It needs to be extended and its method implemented. It cannot be instantiated.This is explain in the example below.
abstract class car
abstract void run();
class maruti extends car
public static void main(String args)
car obj = new maruti();
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
Object in java
Object Object is a unique entity, which contains data and functions (characteristics and behaviour) together in ...read more
What is OOPs?
Object Oriented Programming (OOP) OOPs is an approach to standardize the programs by creating partitioned memory ...read more
Features and Advantages of OOps
Feature of OOPs It makes the complete program simpler by dividing it into a number of ...read more