Lambda conversion in Method invocation context

Peter Levart peter.levart at marand.si
Fri Nov 12 05:28:11 PST 2010


> > I think, you're trying to write this:
> >
> > executor.submit(
> >    #{ System.out.println("Processing a short-lived asynchronous task."); }
> > );
> >
> > ...note the semicolon after println method invocation. Invocation of a void method can not be used as expression.
> >
On 11/12/10, Maurizio Cimadamore wrote:
> The semi-colon should not represent a problem. 

Oh, so this is valid code?

Runnable r = #{  System.out.println() };


Peter


More information about the lambda-dev mailing list