Java - Double number return unexpected : <p>Probably a very simple math question, but this has me a little bit confused.</p>

<p>Can anybody explain to me why this: </p>

<pre><code>public class volumesphere
{
public static void main(String[] args)
{
    double radius = 30.5;
    double PI = Math.PI;
    double volume = (4.0/3) * PI * Math.pow(radius, 3);

    System.out.println(volume);
}
}
</code></pre>

<p>Is different to this?:</p>

<pre><code>public class volumesphere
{
public static void main(String[] args)
{
    double radius = 30.5;
    double PI = Math.PI;
    double volume = (4/3) * PI * Math.pow(radius, 3);

    System.out.println(volume);
}
}
</code></pre>

<p>Specifically in the line:</p>

<pre><code>double volume = (4/3) * PI * Math.pow(radius, 3);
</code></pre>

<p>volume in the first case returns the correct answer at about 1.19*10^5. However, the latter returns a completely different result, around 8.9*10^4.</p>

<p>Can anybody explain this to me please?</p>
