title: I wanted to add an element to my array after sorting the array
body: <p>Here is my code</p>
  
  <pre><code>import java.util.*;
  
  public class ArrayExample {
      public static void main(String[] args) {
          Integer arr[] = {5,4,3,2,15,8,9};
          List&lt;Integer&gt; list = Arrays.asList(arr);            
          Collections.sort(list);
          System.out.println(list);
          list.add(6);// here I am adding 6 to my array.
          System.out.println(list);
          // Here I should get output as [2,3,4,5,6,8,9,15]
      }
  }
  </code></pre>