Passing * in as command line argument in simple Java Calculator
<p>So,
the question is basic. In the code below, when I pass command line argument as <code>java CommandLineDemo 3 5 *</code> the file names in my current directory are being listed. Doing some research in Google I found out we should supply <code>*</code> as <code>'*'</code> in command line. </p>

<p>My question is, how can my code be modified so that it accepts <code>'*'</code> in command line and performs product of <code>operand1</code> and <code>operand2</code></p>

<pre><code>class CommandLineDemo {
    public static void main(String[] args) {
        int operand1 = Integer.parseInt(args[0]);
        int operand2 = Integer.parseInt(args[1]);
        char theOperator = args[2].charAt(0);
        System.out.print(args[0] + args[2] + args[1] + " = ");
        switch(theOperator) {
            case ('+'):
                System.out.println(operand1 + operand2); break;
            case ('-'):
                System.out.println(operand1 - operand2); break;
            case ('*'):
                System.out.println(operand1 * operand2); break;
            case ('/'):
                System.out.println(operand1 / operand2); break;
            default:
                System.out.println("Invalid Operator selected");
        }
    }
}
</code></pre>
