This question already has an answer here:
- The issue of * in Command line argument 5 answers
I am trying to run a java calculator application from command line. the parameters are as follows : operator operand1 operand2. I can successfully run the java program for + and - .
e.g.
java calc + 2 4
java calc - 10 4
But when I try to run
java * 2 5
System.out.println(args[0]);
System.out.println(args[1]);
System.out.println(args[2]);
gives output:
.classpath
.project
.settings
I found out by trial and error that using single quotes( '*' ) solved my problem.
SO i have two questions now.
1. Is using single quotes the right way to do it? (java calc '*' 2 5 )
2. What is the meaning of * in the java command line? (I've tried to find this on internet but didn't find much help)
Thanks, Punit