• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 413
  • Last Modified:

Adapter vs Listener

what is the difference between an adapter and a listener. I have been using ActionListener and ItemListener often. I also came across WindowAdapter but I dont use it.  
0
eugene007
Asked:
eugene007
  • 3
1 Solution
 
objectsCommented:
In that context Adapters are implementations of the listener with empty methods.
This save you having to impelement every method if for example you are only interested in one.
0
 
eugene007Author Commented:
So it means that if a class implements a Listener, it must also implement all the methods in the Listener. In the case of an adapter, you can choose which method you wish to implement.?
0
 
objectsCommented:
Thas right, because the adapter has provided (empty) implementations for you.
0
 
StillUnAwareCommented:
But You won't be able to implement any Adapter, it's a class, and that's what it makes less usable.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Cloud Class® Course: MCSA MCSE Windows Server 2012

This course teaches how to install and configure Windows Server 2012 R2.  It is the first step on your path to becoming a Microsoft Certified Solutions Expert (MCSE).

  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now