title: Use of double vs Double in variable declaration
body: <p>I was trying to create this program with <code>d</code> declared as <code>double</code> and not <code>Double</code>, could you please tell me why this program does not run. Isn't it supposed to be automatically wrapped and unwrapped, something like boxing and unboxing of primitive data type?
  P.S. - I am new to Java I don't remember what it is actually known as but I read somewhere this being referred as boxing and unboxing of primitive types to run methods on them.</p>
  
  <pre><code>public class ToStringDemo {
  
      public static void main(String[] args) {
          double d = 858.48;
          String s = d.toString();
  
          int dot = s.indexOf('.');
  
          System.out.println(dot + " digits " +
              "before decimal point.");
          System.out.println( (s.length() - dot - 1) +
              " digits after decimal point.");
      }
  }
  </code></pre>
  
  <p>Note - Above program gives error at <code>String s = d.toString();</code></p>