title: Initializing arrays in kotlin
body: <p>I am making a haiku generator in kotlin but I am getting a weird 'variable firstLineArray must be initialized' on this block of code.</p>
  
  <pre><code>import java.util.Random
  
  fun oneSyllableWords() : String{
      val oneSyllableWordArray = arrayOf("Life", "Love", "One", "On", "No", "Go")
      val random = Random()
      val randint = random.nextInt(oneSyllableWordArray.size)
      return oneSyllableWordArray[randint]
  }
  
  fun main(args:Array&lt;String&gt;){
      var firstLineArray : Array&lt;String&gt;
      var syllablesRemaining = 5
      while(syllablesRemaining&lt;0) {
          val random = Random()
          val randint = random.nextInt(4) + 1
          for (i in 0..4){
              if(randint == 1){
                  firstLineArray[i] = oneSyllableWords()
              }
          }
      }
  }
  </code></pre>