Below piece of writing from scaladoc for parameter less methods:
//
To summarize, it is encouraged style in Scala to define methods that take no
parameters and have no side effects as parameterless methods, i.e., leaving
off the empty parentheses. On the other hand, you should never define a
method that has side-effects without parentheses, because then invocations
of that method would look like a field selection. So your clients might be
surprised to see the side effects. Similarly, whenever you invoke a function
that has side effects, be sure to include the empty parentheses when you
write the invocation.
//
Question: When a method without parentheses which has side-effects is invoked ,how does it look like a field selection and client will see the side effects ? can give an example if any…