title: How can I sort a JSONArray in JAVA
body: <p>How to sort a JSONArray of objects by object's field?</p>
  
  <p>Input:</p>
  
  <pre><code>[
      { "ID": "135", "Name": "Fargo Chan" },
      { "ID": "432", "Name": "Aaron Luke" },
      { "ID": "252", "Name": "Dilip Singh" }
  ];
  </code></pre>
  
  <p>Desired output (sorted by "Name" field):</p>
  
  <pre><code>[
      { "ID": "432", "Name": "Aaron Luke" },
      { "ID": "252", "Name": "Dilip Singh" }
      { "ID": "135", "Name": "Fargo Chan" },
  ];
  </code></pre>