Person類里有這個(gè)方法public class Person {String shenjingbing(int a,boolean b,double d) {?? ??? ?return null;?}}為什么執(zhí)行這段代碼會(huì)間歇性的報(bào)錯(cuò)呢,有時(shí)又可以運(yùn)行。try {?? ??? ??? ?System.out.println(Person.class.getMethod("shenjingbing", int.class,boolean.class,double.class).toString());//上面換成包裝類.class也一樣?? ???? } catch (NoSuchMethodException e) {?? ??? ??? ?// TODO Auto-generated catch block?? ??? ??? ?e.printStackTrace();?? ??? ?} catch (SecurityException e) {?? ??? ??? ?// TODO Auto-generated catch block?? ??? ??? ?e.printStackTrace();?? ??? ?}
添加回答
舉報(bào)
0/150
提交
取消