When programs get larger, you need some way to divide them into smaller, more manageable pieces. For dividing up control flow, Scala offers an approach familiar to all experienced programmers: divide the code into functions.
def
main(args: Array[String]) {
a) We can assign an object to a function à function object.
b) We can
assign one function object to another function object.
c) Function
object can be passed as a parameter to another function / method.
d)
Functions object are returned from a method or
function.