Functions Named Arguments
# Scala Named Arguments
[ Scala Functions](#)
Normally, when calling a function, arguments are passed one by one in the order they were defined in the function. However, we can also specify the function parameter names, and pass arguments to the function without following the order, as shown in the following example:
object Test { def main(args: Array) { printInt(b=5, a=7); } def printInt( a:Int, b:Int ) = { println("Value of a : " + a ); println("Value of b : " + b ); }}
Execute the above code, the output result is:
$ scalac Test.scala $ scala TestValue of a : 7Value of b : 5
[ Scala Functions](#)
YouTip