Convert String to Double and put it into a Stack
<p>I have this expression, for example:
<code>400 2.11 +</code>
I try to push real numbers into a stack, when i do that, it shows me an error in this part of code</p>

<pre><code>ch = input.charAt(j);
if (ch &gt;= '0' &amp;&amp; ch &lt;= '9' || ch == '.')
    temp = temp + ch;

else if (ch == ' ') {
    x = Double.parseDouble(temp);
    theStack.push(x);
    temp = "";
}
else {

...

public void push(double j) {
        stackArray[++top] = j;
    }
</code></pre>

<p>This is the message</p>

<pre><code>Exception in thread "main" java.lang.NumberFormatException: empty String
    at sun.misc.FloatingDecimal.readJavaFormatString(FloatingDecimal.java:1011)
    at java.lang.Double.parseDouble(Double.java:540)
    at ParsePost.doParse(ParsePost.java:26)
    at InfixApp.main(InfixApp.java:21)
</code></pre>
