Skip to content

Instantly share code, notes, and snippets.

@dgadiraju
Last active January 22, 2017 12:13
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 dgadiraju/62ecd415dee95edf100153401a8d0125 to your computer and use it in GitHub Desktop.
Save dgadiraju/62ecd415dee95edf100153401a8d0125 to your computer and use it in GitHub Desktop.
//Immutable
val i = 10 //Smart enough to figure out the data type
val i: Int = 0 //Data type can be defined explicitly as well
//This does not work i = i + 1, as i is defined as immutable (val)
//Mutable
var j = 20
j = j + 1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment