title: Kotlin data classes contains open functions
body: <p>I was reading kotlin official tutorial, Under the <a href="https://kotlinlang.org/docs/reference/data-classes.html" rel="nofollow noreferrer">data class topic</a>, I came up with a following point.</p>
  
  <blockquote>
    <p>If a supertype has the componentN() functions that are open and return compatible types, the corresponding functions are generated for the data class and override those of the supertype. If the functions of the supertype cannot be overridden due to incompatible signatures or being final, an error is reported;</p>
  </blockquote>
  
  <p>My Questions are,</p>
  
  <p>1) What is <code>componentN()</code> functions ?</p>
  
  <p>2) Does the data class override the open function automatically ?</p>
  
  <p>3) Is following code correct ?</p>
  
  <pre><code>open class SuperDataClass {
  
    open fun componentN() {
       println("from super class")
    }
  }
  
  data class DataClassExample (var name: String): SuperDataClass() {
    //
  }
  </code></pre>