Hey tech readers, welcome to our blog. Today I Will be explaining about Adapter Classes in Java.
Now you might be having a number of questions in your mind…What are Adapter classes..? Where they are used..? How they are used….? And so on…
Don’t worry I will be answering all these questions.
Let’s get started,
This class provides the default modification of all methods of an interface, because of this we don’t need to modify all the methods of the interface. It also reduces the burden of writing complex code☺. These are found in java.awt.event, java.awt.dnd and javax.swing.event packages.
There are different kinds of adapter classes which are as follows:-
java.awt.event Adapter classes
- Hierarchy Bounds Adapter
java.awt.dnd Adapter classes
- DragSource Adapter
javax.swing.event Adapter classes
- Internal Frame Adapter
Following is one of the example showing usage of Adapters
Java WindowAdapter Example
I hope you guys surely must have learnt something about Adapter classes now and also you enjoyed reading it.
Wish to see you guys in our next blog.
Happy Learning !!