title: Java casting (cast operator expressions)
body: <p>The question require me to write a Java program to show the results of the following cast operator expressions:</p>
  
  <p>(double) (23 / 14) + 7.65 </p>
  
  <p>My Code:</p>
  
  <pre><code>public class op { 
  public static void main(String [] args) {
  int num =  23/14;
  double r1 = (double) num;
  double result = r1 + 7.65;
  System.out.println("Results: "+ result);
    }
  }
  </code></pre>
  
  <p>I don't think I have done correctly, what are the problems of my code?
  By the way, can someone tell me what are the differences between long, double, int, float? How do we know when to use these primitive data types? I read an explanation here: <a href="https://docs.oracle.com/javase/tutorial/java/nutsandbolts/datatypes.html" rel="nofollow">https://docs.oracle.com/javase/tutorial/java/nutsandbolts/datatypes.html</a>
  but is there any 'human-version' of the explanation?</p>
  
  <p>Thank you for your help.</p>