title: Scala: abstract class constructor parameter vs Trait val members?
body: <p>I notice that there were several discussions about how to choose between abstract classes and traits, but it seems that none of them focused on the following point. One reason that made me use abstract classes is, they can have constructor parameters, while traits cannot. But why not the following</p>
  
  <pre><code>trait X {
    def haha: Int
  }
  class Y(val haha: Int) extends X
  </code></pre>
  
  <p>and early definition is even not necessary to get everything work properly (which I worried about). The abstract class version is</p>
  
  <pre><code>abstract class X(haha: Int)
  class Y(val haha: Int) extends X(haha)
  </code></pre>
  
  <p>and I don't like the abstract class version because, when you extend several times, these constructor parameters appear everywhere (maybe someone tells me how to avoid this?).</p>
  
  <p>I am aware that abstract classes interpolate with Java better, and match the "is-a" concept more. Despite these, is there any reason that I should use abstract classes somewhere? Thanks!</p>