Working out which out of two numbers are closer to another number Java
<p>I'm trying to figure out a way to work out which out of two numbers are closer to another number lets say we have int a,b,c</p>

<p>a = 0.7 b = 1.8 and c = 1;</p>

<p>How in Java would I work out which number out of a or b is closer to c. </p>