title: Priority Queue of an array of integers in java
body: <p>I want to compare by the second element of the array [[0, 30],[5, 10],[15, 20]].</p>
  <pre><code>PriorityQueue&lt;int[]&gt; heap = new PriorityQueue(intervals.length, (a, b) -&gt; a[1] - b[1]);
  </code></pre>
  <p>But I am getting an error as below</p>
  <p>Line 8: error: array required, but Object found
  PriorityQueue&lt;Integer[]&gt; heap = new PriorityQueue(intervals.length, (a, b) -&gt; a[1] - b[1]);
  ^
  Line 8: error: array required, but Object found
  PriorityQueue&lt;Integer[]&gt; heap = new PriorityQueue(intervals.length, (a, b) -&gt; a[1] - b[1]);</p>
  <p>^
  2 errors</p>