tags: comparison scala

Scala let’s you use method outside of class as well. This actually creates some confusion between method and function in scala.

Method

def aMethod(a: Int): Int = a

Function

val aFunction: (Int) => Int = (a) => a

See also

  1. ETA Expansion