View Single Post
  #1 (permalink)  
Old 11-14-2007, 04:37 PM
polymorphism polymorphism is offline
Member
 
Join Date: Nov 2007
Posts: 1
polymorphism is on a distinguished road
Help me Please..
Hi all,

Code:
public interface ActionListener{ public actionPerformed(ActionEvent e); }
According above code the heading of the JButton method to associate itself with an ActionListener is

Code:
public void addActionListener(ActionListener aListener);
So, Why was the parameter aListener chosen to be of an interface
type in this header?


I think that because the parameter aListener its type interface.

What do you think??
Reply With Quote
Sponsored Links