可以用到java反射机制,Class和Method这些类。 动态调用的方法:a.getClass().getMethod(str, new Class[]{}).invoke(a, new Object[]{}) 其中,a为类的对象