What are the advantages of a anonymous function/function literal in scala?
Answer Posted / Bharat Singh
Anonymous functions (also known as Function Literals) have several advantages:n1. Code conciseness and flexibility: They allow you to create simple, single-purpose functions easily.n2. Closure over variables: An anonymous function can access any outer variable it depends on.n3. Capturing local variables: Anonymous functions can capture values of local variables within their parent scope.
| Is This Answer Correct ? | 0 Yes | 0 No |
Post New Answer View All Answers