Higher Order Function..

higher order function or def function including function-----------

the function which has input parameter as function.. or return function as output is Called Higher Order Function.

scala> def Transform(x: Int, f(x): Int => Int) = {f(x)}
<console>:1:* error:* ':' expected but '(' found.
def Transform(x: Int, f(x): Int => Int) = {f(x)}
                       ^

scala> def Transform1(x: Int, f(x): Int => Int) = {f(x)}
<console>:1: *error:* ':' expected but '(' found.
def Transform1(x: Int, f(x): Int => Int) = {f(x)}
                        ^

scala> def Transform1(x: Int, f(x: Int) => Int) = {f(x)}
<console>:1: *error:* ':' expected but '(' found.
def Transform1(x: Int, f(x: Int) => Int) = {f(x)}
                        ^
\\Correct One is..

scala> def Transform1(x: Int, f: Int => Int): Int = {f(x)}
Transform1: (x: Int, f: Int => Int)Int

scala> Transform1(12, square)
res2: Int = 144

Here Square is a function....

Transform1 is a Higher Order Function.