0

In my netbeans I had written the following code :

package practicejava;

public class Query {

    public static void main(String[] args) {
        double d = 4 / 5 / 6;
        System.out.println(d);
    }
}

Here I was expecting the output to be 0.13333333, but when I run the program it prints 0.

What is the reason of printing 0?

Nicholas K
  • 15,148
  • 7
  • 31
  • 57
Tushar Mia
  • 375
  • 2
  • 9

0 Answers0