title: Difference between function with parentheses and without
body: <blockquote>
    <p><strong>Possible Duplicate:</strong><br>
    <a href="https://stackoverflow.com/questions/4839537/functions-vs-methods-in-scala">Functions vs methods in Scala</a><br>
    <a href="https://stackoverflow.com/questions/7409502/what-is-the-difference-between-def-foo-and-def-foo-in-scala">What is the difference between def foo = {} and def foo() = {} in Scala?</a>  </p>
  </blockquote>
  
  
  
  <p>In scala we can define</p>
  
  <pre><code>def foo():Unit = println ("hello")
  </code></pre>
  
  <p>or </p>
  
  <pre><code>def foo:Unit = println ("hello")
  </code></pre>
  
  <p>I know they are not the same but what is the difference, and which should be used when? </p>
  
  <p>If this has been answered before please point me to that link.</p>