title: How do I return a None in scala?
body: <p>I've been learning Scala recently and one of the things I've seen most is talk about how you shouldn't use null but instead use None. I've had to resort to using null some times because I don't understand how None works exactly.</p>
  
  <p>My biggest problem is when I have methods which return an object say:</p>
  
  <pre><code>def func: SomeObjType = {
  if(something)
      new SomeObjType
  else
      null or None
  </code></pre>
  
  <p>If I return null, it works perfectly well but whenever I try to return None it doesn't work.</p>
  
  <p>What am I doing wrong?</p>