title: Why are arguments passed after ^ in java command line ignored?
body: <p>Code:</p>
  <pre><code>public class Args {
      public static void main(String[] args) {
          if(args.length != 3) {
              System.out.println(&quot;Wrong number of arguments&quot;);
              return;
          }
      
          int num1 = Integer.parseInt(args[0]);   // 1st argument from args
          int num2 = Integer.parseInt(args[2]);   // 3rd argument from args
      
          String msg = args[0] + args[1] + args[2] + &quot;=&quot;;
      
          if(args[1].equals(&quot;+&quot;))
              msg += (num1 + num2);
          else if(args[1].equals(&quot;-&quot;))
              msg += (num1 - num2);
          else if(args[1].equals(&quot;x&quot;))
              msg += (num1 * num2);
          else if(args[1].equals(&quot;/&quot;))
              msg += (num1 / num2);
          else
              msg = &quot;Incorrect operator&quot;;
      
          System.out.println(msg);
      }
  }
  </code></pre>
  <p>Output on command line:</p>
  <pre><code>C:\Desktop&gt;java Args
  Wrong number of arguments
  
  C:\Desktop&gt;java Args 16 + 4
  16+4=20
  
  C:\Desktop&gt;java Args 16 - 4
  16-4=12
  
  C:\Desktop&gt;java Args 16 x 4
  16x4=64
  
  C:\Desktop&gt;java Args 16 / 4
  16/4=4
  
  C:\Desktop&gt;java Args 16 # 4
  Incorrect operator
  </code></pre>
  <p>So far everything was working fine. However, when I passed the below argument, I assumed that according to my code the output should have been <code>Incorrect operator</code>, instead it returned <code>Wrong number of arguments</code>. Everything after the <code>^</code> character is getting ignored. Why is this happening? I know <code>^</code> is used for exponents, apart from this does it have a special meaning in Java which causes the below ignoring behavior?</p>
  <pre><code>C:\Desktop&gt;java Args 16 ^ 4
  Wrong number of arguments
  </code></pre>