dgadiraju
1/23/2017 - 7:37 AM

scala-functions.scala

//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)