java program without using array
<p>I have string <code>w=45,L=23,h=2</code> then I want output product of <code>45,23,2</code></p>

<p>I have following code but it shows the expected output when I input a double digit number </p>

<pre><code>import javax.swing.JOptionPane;  
public class code {  
    public static String stripNonDigits(  
            final CharSequence input /* inspired by seh's comment */){  
    final StringBuilder sb = new StringBuilder(  
            input.length() /* also inspired by seh's comment */);  
    for(int i = 0; i &lt; input.length(); i++){  
        final char c = input.charAt(i);  
        if(c &gt; 47 &amp;&amp; c &lt; 58){  
            sb.append(c);
        }  
    }  
    return sb.toString();  
}
    public static void main(final String[] args){  
         int volume=1;  
        final String input =JOptionPane.showInputDialog("Enter parametersW,L and H in acomma seprated format");  
        final String result = stripNonDigits(input);  
        System.out.print(result);  
        int n=Integer.parseInt(result);  
        System.out.print(n);  
        while(n!=0)  
        {
            volume =volume *( n % 10);  

            n /= 10;  

        }  
        System.out.printf("volume=%d", volume);  
    }  
}  
</code></pre>
