title: Sorting pairs of numbers according to one value - Java
body: <p>I'm interested in an efficient way to store pairs of numbers, and to sort them according to a value of one of the numbers. Say I have a list of numbers:</p>
  
  <pre><code>(1, 2), (3, 5), (4, 3), (7, 8)
  </code></pre>
  
  <p>These pairs need to be stored in some way, then sorted in descending order of the second number, such that the order of these pairs is</p>
  
  <pre><code>(7, 8), (3, 5), (4, 3), (1, 2)
  </code></pre>
  
  <p>What would be the Java code to achieve this? I'm aware of C++'s <code>std::pair</code>, but I was wondering about the procedure in Java. </p>