Anonymous inner classes
Generated and instantiated on the fly
Produce very compact code
Can result in obscure code
6
addActionListener(new ActionListener () {
public void actionPerformed(ActionEvent e) {
System.out.println(“Button Click”);
}
}
);
Previous slide
Back to first slide
View graphic version