A function of 0 parameters.
In the following example, the definition ofgreeting is shorthand, conceptually, for the anonymous class definitionanonfun0, although the implementation details of how the function value is constructed may differ:
object Main extends App { val name = "world" val greeting = () => s"hello, $name" val anonfun0 = new Function0[String] { def apply(): String = s"hello, $name" } assert(greeting() == anonfun0())}Apply the body of this function to the arguments.
Apply the body of this function to the arguments.
the result of function application.
Returns a string representation of the object.
Returns a string representation of the object.
The default representation is platform dependent.
a string representation of the object.