What is this kind of coding style called?

Im wonder what is this kind of coding style called?

This creates a new $class and prints the event e caused by actions to jmi6 that is a button.

Usually you create a new class that implements ActionListener but i find this way of coding to be much more convenient.

[code]
jmi6.addActionListener(
new ActionListener(){
public void actionPerformed(ActionEvent e){
System.out.println(e);
}
}
);
System.gc(); //works even if garbage collector is called

[/code]

Comments

  • Ah nevermind it's called "anonymous class coding".

    Found it when i looked closer at my compiler and it called it a anonymous class.
Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

In this Discussion