adapter class ?

Answers were Sorted based on User's Feedback



adapter class ?..

Answer / janet

An adapter class provides an empty implementation of all
methods in an event listener interface.Adapter classes are
useful when you want to receive and process only some of
the events that are handled by a particular event listener
interface.you can define a new class to act lisener by
extending one of the adapter classes and implementing onlu
those events in which you are interested.
For ex: the MouseMotionListenerAdapter class has two
methods,mouseDragged() and mouseMoved(). The signatures of
these empty are exactly as defined in the
MouseMotionListener interface. If you are interested in
onlu mouse drag events,that you could simply extend
MouseMotionAdapter and implement mouseDragged().

Is This Answer Correct ?    3 Yes 0 No

adapter class ?..

Answer / ravikiran(aptech mumbai)

adapter class provides empty implementation for
eventlistener interface

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More Core Java Interview Questions

Can we have 2 main methods in java class?

0 Answers  


What is the output of the following Java program? class Main { public static void main(String args[]){ final int i; i = 10; System.out.println(i); } } 10. What is the output of the following Java program? class Main { public static void main(String args[]){ final int i; i = 10; System.out.println(i); } }

1 Answers  


What is polymorphism in java? What are the kinds of polymorphism?

0 Answers  


Explain different ways of passing arguments to sub-routine?

1 Answers  


what are variables in java

7 Answers   Wipro,






I need help please send me reply: Write a program "if given a string like 'HAT', the combination's returned should be like ATH,THA,TAH in java"?

4 Answers  


List two java ide’s?

0 Answers  


Write a function for palindrome and factorial and explain?

0 Answers   Honeywell, Huawei, Zomato,


What is an image buffer?

0 Answers  


what is difference between validation.xml & validation rules.xml?

8 Answers   BirlaSoft,


What is numeric promotion?

1 Answers  


public class Garbage { int a=0; public void add() { int c=10+20; System.out.println(c); System.out.println(a); } public static void main(String args[]) { Garbage obj=new Garbage(); System.gc(); System.out.println("Garbage Collected"); obj.add(); } } Above is a code in java used for garbage collection. object obj has been created for the class Garbage and system.gc method is called. Then using that object add method is called.System.gc method if called the obj should be garbage collected?

6 Answers  


Categories