title: What are all the overriding rules between def, val, lazy val, and var in scala?
body: <p>In scala, there are four kinds of member modifier, i.e. <code>def</code>, <code>val</code>, <code>lazy val</code>, <code>var</code>. There is a seemingly complicated and inconsistent set of rules regarding overriding, for instance, <code>def</code> can be overridden by <code>val</code>, while not the other way around. It would be great to see a full list of all these rules.</p>