top button
Flag Notify
    Connect to us
      Site Registration

Site Registration

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

0 votes
388 views
What are the advantages of a Anonymous Function/Function Literal in Scala?
posted Jun 28, 2016 by Roshan

Share this question
Facebook Share Button Twitter Share Button LinkedIn Share Button

1 Answer

+2 votes

Anonymous Function is also a Function but it does not have any function name. It is also known as a Function Literal.
The advantages of a Anonymous Function/Function Literal in Scala:

1.We can assign a Function Literal to variable
2.We can pass a Function Literal to another function/method
3.We can return a Function Literal as another function/method result/return value.

answer Jun 28, 2016 by Shivam Kumar Pandey
...