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.

new ActionListener(){
public void actionPerformed(ActionEvent e){
System.gc(); //works even if garbage collector is called



  • 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!


In this Discussion