adspace


What is an Anonymous Function In Scala? What is a Function Literal in Scala? What are the advantages of a Anonymous Function/Function Literal in Scala?

Answer Posted / Abhiraj Singh Thakur

An anonymous function (or function literal) in Scala is a function that is not given a name. It can be defined inline without any identifier. The syntax for defining an anonymous function is: (params) => expression. Advantages include improved readability, easier one-off functions, and the ability to pass around functionality.

Is This Answer Correct ?    0 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is the latest version of scala?

92


What is the current latest version of scala? What is the major change or update in scala 2.12?

88