title: Why in Scala Long cannot in initialized to null whear as Integer can
body: <p>I am creating my Scala bean which is a configuration to be loaded from a YML config. I want a long property to be null if not specified, but I'm facing below issue. Any idea why?</p>
  
  <pre><code>startOffset: Integer = null
  scala&gt; var endOffset: Long = null
  &lt;console&gt;:11: error: an expression of type Null is ineligible for implicit conversion
     var endOffset: Long = null
                           ^`
  </code></pre>
  
  <p>PS: Yes I can use <code>Option[Long]</code> but wanted clarity and is there anything wrong with this approach.</p>