// Anonymous function = A function with no identifier.
object Main {
def main(args: Array[String]): Unit = {
// Anonymous function (function literal) that takes two Ints and returns their sum.
// (a, b) => a + b ← this is Scala’s concise lambda syntax.
val add: (Int, Int) => Int = (a, b) => a + b
// Use the anonymous function
val result = add(10, 20)
println(result)
}
}
/*
run:
30
*/