title: Removing an element from a primitive array
body: <p>I have a primitive type array from which I want to remove an element at the specified index. What is the correct and efficient way to do that?</p>
  
  <p>I am looking to remove the element in the way mentioned below</p>
  
  <pre><code>long[] longArr = {9,8,7,6,5};
  int index = 1;
  
  List list = new ArrayList(Arrays.asList(longArr));
  list.remove(index);
  longArr = list.toArray(); // getting compiler error Object[] can't be converted to long[]
  </code></pre>
  
  <p>but the above approach looks to work with with Object only not with primitives.</p>
  
  <p>Any alternative to that? I can not use any third party/additional libraries</p>