Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.java.programmer > #30961

Re: New Java 8 syntax?

Path csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!eu.feeder.erje.net!eternal-september.org!feeder.eternal-september.org!mx02.eternal-september.org!.POSTED!not-for-mail
From Jeff Higgins <jeff@invalid.invalid>
Newsgroups comp.lang.java.programmer
Subject Re: New Java 8 syntax?
Date Sat, 31 Jan 2015 12:25:45 -0500
Organization A noiseless patient Spider
Lines 25
Message-ID <maj3cg$alo$1@dont-email.me> (permalink)
References <mahohs$tuh$1@dont-email.me>
Mime-Version 1.0
Content-Type text/plain; charset=utf-8; format=flowed
Content-Transfer-Encoding 7bit
Injection-Date Sat, 31 Jan 2015 17:28:48 +0000 (UTC)
Injection-Info mx02.eternal-september.org; posting-host="c50a9e5d554cfaba13eda1c71e805135"; logging-data="10936"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19CJVfGWGFYTU6GF26kxflEDA1wlfCrkOk="
User-Agent Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Icedove/31.4.0
In-Reply-To <mahohs$tuh$1@dont-email.me>
Cancel-Lock sha1:0M+3gb8Ksl3ytRDLqMTPrYOY6E4=
Xref csiph.com comp.lang.java.programmer:30961

Show key headers only | View raw


On 01/31/2015 12:18 AM, Knute Johnson wrote:
> So I thought that the ; was optional if you had only one statement but
> it won't compile.  If you have a block then the ;s are required.
>
> public class test {
>      public static void main(String... args) {
>
>          new Thread(() -> System.out.println("hello world!") ).start();
>
>          new Thread(() -> { System.out.println("goodbye"); } ).start();
            JLS 8 - 14.8 ExpressionStatement
            Certain kinds of expressions may be used as statements by
            following them with semicolons.
            I don't see any diffs thereabouts in the
            "PDF with diffs from Java SE 7 Edition"

>      }
> }
>
> I bought a pretty good book, Java 8 Lambdas by Richard Warburton.

I have a small collection (~3 or 4) of  O'Reilly books that I keep
fairly handy and a much larger collection of one readers gathering dust.
Will Java 8 Lambdas become a reference or dust collector?

Back to comp.lang.java.programmer | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

New Java 8 syntax? Knute Johnson <nospam@rabbitbrush.frazmtn.com> - 2015-01-30 21:18 -0800
  Re: New Java 8 syntax? Arne Vajhøj <arne@vajhoej.dk> - 2015-01-31 08:25 -0500
    Re: New Java 8 syntax? Knute Johnson <nospam@rabbitbrush.frazmtn.com> - 2015-01-31 09:32 -0800
  Re: New Java 8 syntax? Jeff Higgins <jeff@invalid.invalid> - 2015-01-31 12:25 -0500
    Re: New Java 8 syntax? Knute Johnson <nospam@rabbitbrush.frazmtn.com> - 2015-01-31 09:34 -0800

csiph-web