Re: [問題] Object物件使用

看板java作者時間17年前 (2008/05/18 22:10), 編輯推噓0(000)
留言0則, 0人參與, 最新討論串2/2 (看更多)
Reflection 的寫法 最近剛好學到,現學現賣一下XD class A { public test(); } Object test=new A(); test.getClass().getMethod("test", null).invoke(test, null); 至於各參數代表的意義就自己查一下api吧 ※ 引述《b60413 (None)》之銘言: : 請問我創造一個Object變數 但是在new的時候是使用A class : 那這個變數有辦法使用A class的method嗎? : ex: : class A { : public test(); : } : Object test=new A(); : //test.test(); -- ※ 發信站: 批踢踢實業坊(ptt.cc) ◆ From: 221.169.231.115
文章代碼(AID): #18C3ZUnT (java)
討論串 (同標題文章)
文章代碼(AID): #18C3ZUnT (java)