0 votes
in Scala Constructs by
What is Scala Anonymous Function?

1 Answer

0 votes
by
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)

Related questions

0 votes
asked Sep 11, 2022 in Scala Constructs by sharadyadav1986
0 votes
asked Sep 12, 2022 in Scala Constructs by Robin
...