title: Casting Double object to int
body: <p>How can I convert from a Double object to an int? The following code works but seems slightly unconventional (with casting twice):</p>
  
  <pre><code>Double d = new Double(4.0);
  int i = (int)(double)d;
  </code></pre>
  
  <p>When I try <code>int i = (int)d</code>, I get an error from Eclipse (<code>Cannot cast from Double to int</code>), which makes sense. Nevertheless, is there a simpler way of converting a Double object to an int?</p>