I started reading an android tutorial and I found an example where I found the following situation:
button.setOnClickListner(new View.OnClickListener() { //SOME CODE} );
Now View.OnClickListener is an interface, then what I understand is that doing in this way I create an instance of an object of OnClickListener type that is formed by the code in the braces. Is it so? But is it a java particular way to make things easier or is it a particular android programming choice? Because I never saw something like this in Java, maybe I didn't study a lot.