Write a program to make calculator using switch case.

public class Calculator
{
    public static void main(String arg[])
   {
            int n1 =Integer.parseInt(arg[0]);
            int n2 =Integer.parseInt(arg[1]);
            int c =Integer.parseInt(arg[2]);
            switch(c)
            {
                  case 1:  System.out.println("Answer is: "+(n1+n2));
                                    break;
                  case 2:  System.out.println("Answer is: "+(n1-n2));
                                    break;
                  case 3:  System.out.println("Answer is: "+(n1*n2));
                                    break;
                  case 4:  if(n2==0)
                                      {
                                         System.out.println("This value is not allowed.");
                                       }
                                       else
                                      {
                                        System.out.println("Answer is: "+(n1/n2));
                                      }
                                        break;                     
                 default:  {
                                       System.out.println("Invalid entry..");
                                    }                      
                  }
            }
}