posted 17 years ago
The best example is when using Gui's, and when creating a button (for example) supplying the implementation of it's ActionListener in an anonymous class using the ActionListener interface from java.awt.
Study this code:
----------------------------
Do you understand?
Using the ActionPerformed interface in the addActionListener of the button component, i created an anonymous class (implementing the ActionListener interface) to System.out "Button Clicked" and a number each time.
I hope that helps.