Skip to content

Instantly share code, notes, and snippets.

@johirbuet
Last active December 15, 2016 23:32
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 johirbuet/a764a9958bc5be30e91d27e6c09050d3 to your computer and use it in GitHub Desktop.
Save johirbuet/a764a9958bc5be30e91d27e6c09050d3 to your computer and use it in GitHub Desktop.
object ValVar{
def main(args : Array[String])
{
val x=5;
x=10; //Error
var y=5;
y=10; //ok
}
}
@johirbuet
Copy link
Author

difference between val and var

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