title: Java integer-double division confusion
body: <p><strong>Program 1</strong></p>
  
  <pre><code>int sum = 30;  
  double avg = sum / 4; // result is 7.0, not 7.5 !!!
  </code></pre>
  
  <p>VS.</p>
  
  <p><strong>Program 2</strong></p>
  
  <pre><code>int sum= 30   
  double avg =sum/4.0 // Prints lns 7.5
  </code></pre>
  
  <p>Is this because the '4' in program 1 is acting as a  literal integer?  so 30/4 would give me 7. However since this data type is a double, we need to add a .0 to end. so '7.0'</p>
  
  <p>Program 2 has 4.0 which is acting as a literal double.  an int/double would always give double because it more precise. so we get '7.5'. I don't understand what double data type is doing to the result though.. it really doesn't need to do anything since the conditions of the double data type  are already satisfied.(have the most precise result out of the computation). </p>
  
  <p>Am I wrong? I encourage you to correct me! This is how I learn.. :) </p>