title: Kotlin ArrayList and arrayOf have different behaviour for toString() method
body: <p>Why would the <strong>Use case 1</strong> (<code>arrayOf</code>) print the cryptic object address while <code>ArrayList</code> correctly understands and print the object properties. It is odd because, not just <code>ArrayList</code>, but <code>setOf</code>, <code>listOf</code> etc. all print the object properties correctly. It's seems <code>arrayOf</code> is somehow different.</p>
  <pre class="lang-kotlin prettyprint-override"><code>data class Student(
      val id: String,
      val name: String
  )
  
  fun main() {
      val hello1 = Student(&quot;1&quot;, &quot;A&quot;)
      val hello2 = Student(&quot;2&quot;, &quot;B&quot;)
  
      // USE CASE 1
      val arr = arrayOf(hello1, hello2)
      println(arr)
          
      // OUTPUT: [LStudent;@37f8bb67
  
      //USE CASE 2
      val arr2 = ArrayList&lt;Student&gt;()
      arr2.add(hello1)
      arr2.add(hello2)
      println(arr2)
          
      // OUTPUT: [Student(id=1, name=A), Student(id=2, name=B)]    
  
  }
  </code></pre>