what is difference betweeen Funciton and Method in Scala


1 Answer(s)


Hi Rakesh,

Scala has both functions and methods and we use the terms method and function interchangeably with a minor difference.

A Scala method is a part of a class which has a name, a signature, optionally some annotations, and some bytecode where as a function in Scala is a complete object which can be assigned to a variable. In other words, a function, which is defined as a member of some object, is called a method.

Hope this helps.

Also refer:
https://stackoverflow.com/questions/2529184/difference-between-method-and-function-in-scala

Thanks