title: How to sort an arraylist of objects java?
body: <p>So I want an arraylist of objects in java.</p>
  
  <p>I have <code>object1.number</code> and <code>object2.number</code>, <code>object3.number</code>, etc... but those objects have other properties besides <code>number</code>, such as <code>name</code>, <code>distance</code>, etc...</p>
  
  <p>So if it was sorting a string in a <code>array</code> it would just be, put a string in a <code>temporal</code> and let the other string take its place... but in an <code>araryList</code> of objects, how can I do it?</p>
  
  <p>Can I just move objects to that position of the array?</p>
  
  <p>Thanks.</p>