public Command(Object obj, String methodName, Object[] arguments) {
            receiver = obj;
            args = arguments;
            Class cls = obj.getClass();           // get the object's "Class"
            Class[] argTypes = new Class[args.length];
            for (int i = 0; i < args.length; i++)   // get the "Class" for each
            {
                argTypes[i] = args[i].getClass();  //    supplied argument
            }
            // get the "Method" data structure with the correct name and signature
            try {
                action = cls.getMethod(methodName, argTypes);
            } catch (NoSuchMethodException e) {
                System.out.println(e);
            }
        }