title: Efficient way to create like 1000 instance of a class
body: <p>As a newbie in Kotlin, i want to ask a question. Let’s say that i have class Dog like below,</p>
  <pre><code>data class Dog(val breed : String, val gender : String, val name : String, val age: Int){}
  </code></pre>
  <p>I want to make 1000 instances of this Dog class and add all of instances in an arrayList and later i will use this list in different activities. Imagine that I have an activity which only shows Labradors . So i have to take that arrayList which contains all of my Dogs and filter the breed according to Labrador and show the user.</p>
  <p>As i read in articles i think this is an expensive way but i don’t know what the efficient way is to do this. Cause i will create all instances manually like below.</p>
  <pre><code>fun dogMaker(){
      val dog1 = Dog(&quot;example&quot;,&quot;example&quot;,&quot;example&quot;,1)
      val dog2 = Dog(&quot;example&quot;,&quot;example&quot;,&quot;example&quot;,1)
      val dog3 = Dog(&quot;example&quot;,&quot;example&quot;,&quot;example&quot;,1)
      val dog4 = Dog(&quot;example&quot;,&quot;example&quot;,&quot;example&quot;,1)
      val dog5 = Dog(&quot;example&quot;,&quot;example&quot;,&quot;example&quot;,1)
      //... goes on...
  
  }
  </code></pre>
  <p>Could you suggest me an efficient way? Thanks in advance.</p>