Convert double of null value to String Error
<p>How to solve this problem</p>

<pre><code>public class DoubleTest {

    public static void main(String[] args) {
        double dbl = (Double) null;
        String str = Double.toString(dbl);
        System.out.println(str);

    }

} 
</code></pre>

<p>With Error:</p>

<pre><code>Exception in thread "main" java.lang.NullPointerException
    at test.java.DoubleTest.main(DoubleTest.java:6)
</code></pre>

<p>Any idea please?</p>

<p>I am asking this because I have a method that return Double which I have to convert to String again.</p>

<p>If my method returns <strong>null</strong>, then this problem happens.</p>
