title: Kotlin VS Scala: Implement methods with primary constructor parameters
body: <p>In Scala you can write code like this.</p>
  
  <pre><code>trait List[T] {
     def isEmpty() :Boolean
     def head() : T
     def tail() : List[T]
  }
  
  class Cons[T](val head: T, val tail: List[T]) :List[T] {
     def isEmpty = false
  }
  </code></pre>
  
  <p>you don't need to override tail and head they are already defined, but in Kotlin I had to code this. </p>
  
  <pre><code>interface List&lt;T&gt; {
     fun isEmpty() :Boolean
     fun head() : T
     fun tail() : List&lt;T&gt;
  }
  
  class Cons&lt;T&gt;(val head: T, val tail: List&lt;T&gt;) :List&lt;T&gt; {
      override fun isEmpty() = false
      override fun head() = head
      override fun tail() = tail
  }
  </code></pre>
  
  <p>My question is "is their a better way to write my Kotlin code? "</p>