It is a good practice to have an explicit return type for public methods.
Because you could think that returned type is Runnable? Wrong, it's Runnable{def sayIt(): Unit}.
As a side-effect, this also increases compilation times, as whenever sayHelloRunnable changes implementation, it also changes the signature so everything that depends on it must be recompiled.
Login in to like
Login in to comment