本帖最后由 王浩骅 于 2013-6-2 10:19 编辑
package com.itheima;
import java.util.ArrayList;
public class Test2 {
/**
* @param args
*/
public static void main(String[] args) {
// TODO Auto-generated method stub
ArrayList<Integer> collection = new ArrayList<Integer>();
collection.getClass().getMethod(("add", Object.class).invoke(collection,"abc");
System.out.println(collection.get(0));
}
}
Exception in thread "main" java.lang.Error: Unresolved compilation problem:
Syntax error, insert ")" to complete ArgumentList
at com.itheima.Test2.main(Test2.java:13)
|
|