title: Difference between double and Double in comparison
body: <p>I know that <code>Double</code> is a a wrapper class, and it wraps <code>double</code> number. Today, I have seen another main difference : </p>
  
  <pre><code>double a = 1.0;
  double b = 1.0;
  Double c = 1.0;
  Double d = 1.0;
  System.out.println(a == b);  // true
  System.out.println(c == d);  // false
  </code></pre>
  
  <p>So strange with me !!!</p>
  
  <p>So, if we use <code>Double</code>, each time, we must do something like this :</p>
  
  <pre><code>private static final double delta = 0.0001;
  System.out.println(Math.abs(c-d) &lt; delta); 
  </code></pre>
  
  <p>I cannot explain why Double make directly comparison wrong. Please explain for me.</p>