title: Array declaration in Kotlin
body: <p>The code below is an example for Array declaration in Kotlin,</p>
  
  <pre><code>fun main(args: Array&lt;String&gt;) {
  
      var a = Array&lt;Int&gt;(2){0}
      a[0] = 100
      a[1] = 200
      print(a[1])
  
  }
  </code></pre>
  
  <p>Here variable <strong>a</strong> is an array of size 2 and having values 100 and 200 and it is printing the value of <strong>a[1]</strong> as <strong>200</strong>.</p>
  
  <p>My question is -> <strong>What is the role of "0" in  var a = Array(2){0}</strong>?</p>
  
  <p>I changed the value of <strong>"0"</strong> to some other integer value, still it is working fine, but i was not able to find the use case of it. Can anyone explain it?</p>
  
  <p>Any help will be appreciated.</p>
  
  <p>Thanks.</p>