On 06.03.2009 00:28, 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 nd > use this as a parameter or am I miss something? This is not exactly true. You can instantiate it in one code location only (because you do not have a name to refer to it) but you can of course have multiple instances and use it in multiple places (e.g. by having a creator method that returns the super class or interface that you use to define the anonymous class). > It's some years ago but as I looked into function parameters in Java itas just a pain to use. Maybe Java7 added some nice features. Not really, as Jeff already pointed out. I'd concede that it is more cumbersome than in Ruby with blocks because of the limitations (variables used inside the anon class must be final for example). Kind regards robert