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.
Ввійдіть щоб вподобати
Ввійдіть щоб прокоментувати