int.class, long.class, boolean.classinvoke(obj, new Object[]{ "string", new Integer(1), new Long((long)1), new Boolean(false));

解决方案 »

  1.   

    Invokes the underlying method represented by this Method object, on the specified object with the specified parameters. Individual parameters are automatically unwrapped to match primitive formal parameters, and both primitive and reference parameters are subject to widening conversions as necessary. The value returned by the underlying method is automatically wrapped in an object if it has a primitive type. If the corresponding formal parameter has a primitive type, an unwrapping conversion is attempted to convert the object value to a value of a primitive type. If this attempt fails, the invocation throws an IllegalArgumentException. 
    我想大概意思就是用Long 来表示long类型,系统会自动unwrapped to match primitive
      

  2.   

    Object obj, Object[] argsobj为对象主体,args为参数列表数组,如果参数为原始数据类型,则使用它的对应java对象。比如int对应Integer要传入args,先创建一个定长的Object数组,然后以参数为基创建出所有参数对象,最后将这些对象按顺序push进Object数组即可
      

  3.   

    比如java test.test1  c1 c2 -t c4
    那么args[0]= "c1",args[1]="c2",依此类推
      

  4.   

    yes,thank you
    biti_9512207(波波斯基)