Google News
logo
Scala - Interview Questions
What is Scala Anonymous Function?
Standard functions generally include a name, a list of parameters, a return type, and a body. An anonymous function is one for which a name is not given. In Scala, anonymous functions are defined by a lightweight syntax. In the source, anonymous functions are referred to as function literals, and at run time, these function literals become objects called function values. We can use it to create inline functions.

Syntax :
(z:Int, y:Int)=> z*y
Or
(_:Int)*(_Int)​
Advertisement