title: Create New Instance of Kotlin Object
body: <p>I have an object <em>QuickSort</em> that I am attempting to create 2 instances of. When I try to create 2 separate instances I can see that it is only using one instance because I have a count in the <em>QuickSort</em> class that is inaccurate. Kotlin does not use <strong>new</strong> in the syntax, so how would I go about this?</p>
  
  <pre><code>object QuickSort {
        var count = 0;
        quickSortOne(...){
            ...
            count++
            ...
        }
        quickSortTwo(...){
            ...
            count++
            ...
        }
    } 
  </code></pre>
  
  <p>Here is how I am attempting to create my 2 instances.My goal is to have <em>quickSort1</em> and <em>quickSort2</em> be 2 separate instances.</p>
  
  <pre><code>var quickSort1 = QuickSort
  quickSort1.quickSortOne(...)
  
  var quickSort2 = QuickSort
  quickSort2.quickSortTwo(...)
  </code></pre>
  
  <p><strong>Attempted Solution</strong>: Converting <em>QuickSort</em> from an object to a class. This still results in the same instance being used as seen by the count of the second method including the first calls count.</p>
  
  <pre><code>class QuickSort {
        var count = 0;
        quickSortOne(...){
            ...
            count++
            ...
        }
        quickSortTwo(...){
            ...
            count++
            ...
        }
    }
  </code></pre>
  
  <p>...</p>
  
  <pre><code>var quickSortFirst = QuickSort()
  printTest(quickSortFirst.quickSortFirst(arrayList, 0, arrayList.size - 1))
  
  var quickSortLast = QuickSort()
  printTest(quickSortLast.quickSortLast(arrayList, 0, arrayList.size - 1))
  </code></pre>