Skip to content

Instantly share code, notes, and snippets.

@chrislewis
Created June 15, 2011 18:34
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 chrislewis/1027766 to your computer and use it in GitHub Desktop.
Save chrislewis/1027766 to your computer and use it in GitHub Desktop.
statement-vs-expression
// It's a statement.
int bInt = 0;
if (cond)
bInt = 1;
else
bInt = 0;
// It's an expression.
val bInt = if (cond) 1 else 0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment