title: Java: Should I use float or Float?
body: <p>My colleague told me that I should use <code>float</code> whenever possible to reduce the object creation and increase the performance. Java silently converts <code>float</code> to <code>Float</code> (this needs some computational power) whenever necessary. So it seems to me that the only need for <code>Float</code> is when one needs to use the object <code>Float</code> very often instead of its primitive.</p>
  <p>When looking at <code>java.awt.Color</code>, it is using the <code>Float</code>, perhaps unnecessarily.</p>
  <p>When would one need to prefer <code>Float</code> over <code>float</code> in Java?</p>