What is the difference between listeners and adapters?

后端 未结 5 421
再見小時候
再見小時候 2021-02-02 11:07

I\'m trying to differentiate between listeners and adapters.

Are they pretty much the same but in listeners you have to implement all the methods in the interface, but w

5条回答
  •  野性不改
    2021-02-02 11:50

    There are several Adapter classes such as the MouseAdapter, KeyAdapter, WindowAdapter that one can extend thus avoiding writing the methods that you don't actuality need.

    The thing with interfaces is that you have to write out all the methods you do not need. The Adapter class can further be Sub Classed as a way to override the method required.

    http://www.cafeaulait.org/course/week7/19.html

提交回复
热议问题