Why the result of 1/3=0 in java?
<p>I was writing this code in java.</p>

<pre><code>public static void main(String[] args) {
    double g = 1/3;
    System.out.printf("%.2f", g);
}
</code></pre>

<p>the result is zero and how to solve this problem?</p>
