Home »
MCQs »
Scala MCQs
The output of the following block of code will be | Scala Question 12
83. The output of the following block of code will be -
object myObject {
var multiplier = 5;
def main(args: Array[String]) {
println(calculator(45));
}
val calculator = (i:Int) => i * multiplier;
}
- 45
- 5
- Error
- 225
Answer: D) 225
Explanation:
The calculator method is a closure.