标签:string 对象 upper getc throw hello ati except font
请看下面的代码:
import java.lang.reflect.Method;
class MethodInvokeTest {
public static void main(String[] args) throws Exception {
String str = "hello";
Method m = str.getClass().getMethod("toUpperCase");
System.out.println(m.invoke(str)); // HELLO
}
}
标签:string 对象 upper getc throw hello ati except font
原文地址:https://www.cnblogs.com/programb/p/13021375.html