title: Dividing two integers to a double in java
body: <p>I can see this is a common problem for new programmers, however I didn't succeed in implementing any of the solution to my code. Basically I want to divide w and v, which must be saved to a double variable. But it prints [0.0, 0.0, ... , 0.0]</p>
  
  <pre><code>public static double density(int[] w, int[] v){
  double d = 0;
      for(L = 0; L &lt; w.length; L++){
          d = w[L]  /v[L];
      }
      return d;
  }
  </code></pre>