aspose file tools
The moose likes Beginning Java and the fly likes Doubt on interface instantiation in ActionListener class Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login
JavaRanch » Java Forums » Java » Beginning Java
Reply locked New topic
Author

Doubt on interface instantiation in ActionListener class

satya sahu
Ranch Hand

Joined: Mar 26, 2003
Posts: 97
jButton2.addActionListener(new ActionListener(){
public void actionPerformed(ActionEvent e){

}
});
ActionListener is an interface. Interfaces can't be instantiated. Then how in the above anonymous implementation new of the interface is done?
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 56175
    
  13

Please do not cross-post the same question in multiple forums. It wastes people's time when multiple redundant conversations take place. Please read this for more information.


[Smart Questions] [JSP FAQ] [Books by Bear] [Bear's FrontMan] [About Bear]
 
I agree. Here's the link: http://ej-technologies/jprofiler - if it wasn't for jprofiler, we would need to run our stuff on 16 servers instead of 3.
 
subject: Doubt on interface instantiation in ActionListener class
 
Similar Threads
Anonymous classes
interface question,help!
Doubt on interface instantiation in ActionListener class
anonymous inner class
can anonymous inner class implement an interface ?