title: Kotlin Array creation: No value passed for parameter 'init'
body: <p>I am converting a Java file into Kotlin in Android Studio and I am getting this error:</p>
  
  <blockquote>
    <p>No value passed for parameter 'init'</p>
  </blockquote>
  
  <p>I modified the code slightly by adding <strong>lateinit</strong>  </p>
  
  <p>The java code is:</p>
  
  <pre><code> private TextView[] dots;
   private int[] layouts;
  
  private void addBottomDots(int currentPage)
  {
      dots = new TextView[layouts.length]; 
      //some lines here
  }
  </code></pre>
  
  <p>And corresponding Kotlin code is</p>
  
  <pre><code>private lateinit var dots: Array&lt;TextView&gt;
  private lateinit var layouts: IntArray
  
  private fun addBottomDots(currentPage: Int)
      {
         dots = Array&lt;TextView&gt;(layouts.size) // error happens here
         // some lines here
  
      }
  </code></pre>
  
  <p>As I am new in Kotlin, I can't figure out why this is the reason</p>