title: What does a lazy val do?
body: <p>I noticed that Scala provide <code>lazy vals</code>. But I don't get what they do.</p>
  
  <pre><code>scala&gt; val x = 15
  x: Int = 15
  
  scala&gt; lazy val y = 13
  y: Int = &lt;lazy&gt;
  
  scala&gt; x
  res0: Int = 15
  
  scala&gt; y
  res1: Int = 13
  </code></pre>
  
  <p>The <a href="http://en.wikipedia.org/wiki/Read-eval-print_loop" rel="noreferrer">REPL</a> shows that <code>y</code> is a <code>lazy val</code>, but how is it different from a normal <code>val</code>?</p>