How listener identify that the event came from a particular
object?



How listener identify that the event came from a particular object?..

Answer / Nitish Mathur

In Java, an event is dispatched to all registered listeners. However, each listener can check if the source of the event (EventObject) corresponds to the specific object it's listening for by using the 'getSource()' method of the event object.

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More Core Java Interview Questions

Why doesn't the java library use a randomized version of quicksort?

1 Answers  


Why are strings immutable in Java?

1 Answers  


Which method is used to find that the object is exited or not?

2 Answers  


Is singleton thread safe in java?

1 Answers  


How hashmap increases its size in java?

1 Answers  


What is Map interface?

3 Answers   Wipro,


What is an interface in java?

1 Answers  


Why do we need main method to execute a java program?

1 Answers   Virtusa,


Explain the difference between extends thread vs implements runnable in java?

1 Answers  


What is Java Package and which package is imported by default?

1 Answers  


A non-static inner class may have object instances that are associated with instances of the class’s outer class. A static inner class does not have any object instances.

1 Answers  


What is a container in a gui?

1 Answers  


Categories