Rounding with DecimalFormat in Java
<p>Let's look at the following statements in Java.</p>

<pre><code>System.out.println(new DecimalFormat("0").format(2.4)); //returns 2

System.out.println(new DecimalFormat("0").format(2.5)); //returns 2  &lt;---Concentrate here
System.out.println(Math.round(2.5));                    //returns 3

System.out.println(new DecimalFormat("0").format(2.6)); //returns 3
System.out.println(new DecimalFormat("0").format(3.5)); //returns 4
</code></pre>

<p>In the above statements, all other cases are obvious except the following.</p>

<pre><code>System.out.println(new DecimalFormat("0").format(2.5));
</code></pre>

<p>It should return <code>3</code> but it returns <code>2</code>. How?</p>
