Skip to content

Instantly share code, notes, and snippets.

@lqd
Created February 3, 2012 00:11
Show Gist options
  • Save lqd/1726656 to your computer and use it in GitHub Desktop.
Save lqd/1726656 to your computer and use it in GitHub Desktop.
Lombok.val loop semantics modification
int i = 0;
for (val s = "", j = 2; i < 1; ++i) // having different types for local variables is illegal in Java :)
{
System.out.printf("s (%s): '%s'\n", s.getClass().getName(), s);
System.out.printf("j: '%s'\n", j);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment