What is the purpose of a listener in Java?

后端 未结 7 484
再見小時候
再見小時候 2020-12-04 20:23

I looked for this online, but couldn\'t find an adequate explanation to what it exactly does. What I saw was a Java Interface and it was passed as a parameter in another cla

7条回答
  •  误落风尘
    2020-12-04 21:05

    Listeners do some work when an event occurs. They are called as "Event Listeners". Events like click, hover etc.. For Example, we have ActionListener interface in Java. It calls actionPerformed() method when an event occurs. You can refer http://java.about.com/od/a/g/Actionlistener.htm for more info.

提交回复
热议问题