Skip to content

Instantly share code, notes, and snippets.

@irbull
Created March 26, 2014 00:03
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save irbull/9774172 to your computer and use it in GitHub Desktop.
Save irbull/9774172 to your computer and use it in GitHub Desktop.
MyInterface r2 = () ->
System.out.println("Hello, world");
System.out.println("Goodbye, world!");
vs.
MyInterface r2 = () -> {
System.out.println("Hello, world");
System.out.println("Goodbye, world!");
};
@robinst
Copy link

robinst commented Mar 26, 2014

Right, with methods without a return type (void), the above can indeed lead to unnoticed errors. But with format-on-save, the indentation would be changed:

MyInterface r2 = () ->
    System.out.println("Hello, world");
System.out.println("Goodbye, world!");

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment