Alex Rivera | Logout

The issue of * in Command line argument

Asked 2010-04-27T05:15:05.610
18

I wrote a program in Java that accepts input via command line arguments. I get an input of two numbers and an operator from the command line. To multiply two numbers, I have to give input as e.g. 5 3 *, but it's not working as written.

Why is it not accepting * from the command line?

Edit
Report

1 Answer

2

Try surrounding the * with quotes like "*". The star is a reserved symbol on the command line.

answered 2010-04-27T05:17:56.790

Your Answer