Home »
MCQs »
Scala MCQs
The output of the following block of code is | Scala Question 11
81. The output of the following block of code is -
object Demo {
def sub( a:Int, b:Int ) = {
println( (a-b) );
}
def main(args: Array[String]) {
sub(b = 5, a = 7);
}
}
- -2
- 2
- Error
- None of these
Answer: B) 2
Explanation:
Named arguments are passed and used.