I can define a function or a method in Scala as below:
def myMethod: Boolean = true
or
val myBoolVal = () => true
Which one is preferred any why? Is defining a myMethod has compiler benefits? Any suggestions?
I can define a function or a method in Scala as below:
def myMethod: Boolean = true
or
val myBoolVal = () => true
Which one is preferred any why? Is defining a myMethod has compiler benefits? Any suggestions?