Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 408
  • 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

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

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