title: Write a program that accepts two numbers and a operator like (+,-,*, /) as command line arguments and perform the operation indicated by operator
body: <p>Write a program that accepts two numbers and a operator like (+,-,*, /) as command line arguments and perform the appropriate operation indicated by operator.If the user enters any other character the appropriate message will be displayed. The output of the program should be displayed to the user.</p>
  
  <p>My Code is this</p>
  
  <pre><code>public class Practical4
  {
  
      public static void main(String[] args)
      {
          if(args.length==0)
          {
          System.out.println("No arguments are passed");
          }
          else
          {
  
          int a=Integer.parseInt(args[0]);
          String p=args[1];
          int b=Integer.parseInt(args[2]);
  
          switch(p)
          {
              case "+":
                  System.out.println("Addition of "+a+" and "+b+" : "+(a+b));
                  break;
  
              case "-":
                  System.out.println("Subtraction of "+a+" and "+b+" : "+(a-b));
                  break;
  
              case "*":
                  System.out.println("Multiplication of "+a+" and "+b+" : "+(a*b));
                  break;
  
              case "/":
                  System.out.println("Division of "+a+" and "+b+" : "+(a/b));
                  break;
  
              case "%":
                  System.out.println("Modulo of "+a+" and "+b+" : "+(a%b));
                  break;
  
  
              default:
                  System.out.println("Please Enter '+', '-', '*', '/' &amp; '%' operator only.");
          }
          }
  
      }
  
  }
  </code></pre>
  
  <p>and i am getting this Error</p>
  
  <pre><code>java:17: incompatible types
  found   : java.lang.String
  required: int
          switch(p)
                 ^
  1 error
  </code></pre>
  
  <p>Please Give the Solution. Thanks</p>