import java.lang.reflect.Method;
import java.util.ArrayList;
public class Prop {
public static void main(String[] args) throws NoSuchMethodException, Exception {
ArrayList<Integer> arr = new ArrayList<Integer>();
Class arr_class = arr.getClass();
Method mm = arr_class.getMethod("add", Object.class);
mm.invoke(arr, "hello");
mm.invoke(arr, "world");
System.out.println(arr);
}
}
[hello, world]