title: How do you get absolute values and square roots
body: <p>How do you get a square root and an absolute value in Java?</p>
  <p>Here is what I have:</p>
  <pre><code>if (variable &lt; 0) {
      variable = variable + variable2;
  }
  </code></pre>
  <p>But is there an easier way to get the absolute value in Java?</p>
  <pre><code>variable = |variable|
  </code></pre>