Skip to content

Instantly share code, notes, and snippets.

@dgadiraju
Created January 23, 2017 07:37
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/9294d7ccfefa60fae2c4bcd96219af2b to your computer and use it in GitHub Desktop.
Save dgadiraju/9294d7ccfefa60fae2c4bcd96219af2b to your computer and use it in GitHub Desktop.
//Creating functions
def addIntegers(i: Int, j: Int): Int = {
i + j
}
//Anonymous function assigned to a variable
val addIntegers = (i: Int, j: Int) => {
i + j
}
//Invocation
addIntegers(1, 2)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment