title: How to sort integer array in ascending and descending order using lambda only in java
body: <pre><code>int[] arr2 = new int[] {54, 432, 53, 21, 43};
  </code></pre>
  
  <p>I am using this to sort but it is giving an error.</p>
  
  <pre><code>Arrays.sort(arr2, (a, b) -&gt; a - b);
  </code></pre>
  
  <p>This is also giving an error.</p>
  
  <pre><code>arr2.sort((a, b) -&gt; a - b);
  </code></pre>