Sandor Szs wrote: > On 05.03.2009, at 19:22, Sebastian Hungerecker wrote: > >> Sandor Szs wrote: >>> For the functional part in Java you can define classes which you use >>> as pseudo >>> function parameters, but that's really not nice to use, because >>> foreach >>> operation you want to p.e. map(), you have to define a whole class in >>> a separate >>> file. >> No, you don't. Java has anonymous classes. > > Yes that's true, but you can instantiate an anonymous class just once > and use this as a parameter or am I miss something? You am miss something. > It's some years ago but as I looked into function parameters in Java it > was just a pain to use. Maybe Java7 added some nice features. This has been around since the beginning. class Main { public static void main(String[] args) { System.out.println(new Object( ) { public String toString() { return "Aloha!"; } }); } }