Home »
Code Examples »
Scala Code Examples
Scala - Create a multiplier function Code Example
The code for Create a multiplier function
object MyClass {
def main(args: Array[String]) {
var b = 5
val multiplier = (a: Int) => a * b
println(multiplier(3))
}
}
/*
Output:
15
*/
Code by IncludeHelp,
on August 9, 2022 05:17