What are listeners in Java, what are its different types | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

What are listeners in Java, what are its different types

Need easy understandable meanings of listener and it's types

23rd Sep 2017, 4:15 AM
Nikhil Shrivastava
Nikhil Shrivastava - avatar
2 Answers
+ 11
Listeners are simply objects that observe another object and run the specified method on a particular change of the object they're listening to. As you can define your own listeners, it is not possible to provide a full list of what listeners an handle. But the most common use of them might be gui interaction, like handling mouse and keyboard events.
23rd Sep 2017, 8:23 AM
Tashi N
Tashi N - avatar
+ 1
thanks Tashi
23rd Sep 2017, 8:41 AM
Nikhil Shrivastava
Nikhil Shrivastava - avatar