Why to use empty parentheses in Scala if we can just use no parentheses to define a function which does not need any arguments?

It’s mostly a question of convention. Methods with empty parameter lists are, by convention, evaluated for their side-effects. Methods without parameters are assumed to be side-effect free. That’s the convention.

Leave a Comment