看板 java 關於我們 聯絡資訊
※ 引述《loveflames (.....)》之銘言: : ※ 引述《qrtt1 (愚人)》之銘言: : 那個網站之前已經去過了 : 一開始是用object_name.getClass().getName() : 可是物件不是都要先預設類別嗎? : 這樣不是變成了要先知道有什麼檔 : 而不能用字串來直接設定物件類別? ==站內== Java檔 = 字串? = 類別? 看你的原文我會想回你, 用IO把 .java load進來做parse Class name的動作。 如果你一開始是說用 "字串" 設定物件類別, 你可以早一天得到很直接的解答。 雖然"設定"這個字眼還是很模糊, 可以分成取得實體和取得class兩種。 -- 要問問題的人請把問題敘述清楚啊, 不想要答案就不要上來亂槍打鳥浪費別人時間~ 置底文章有寫清楚 [站內] 、 [看板]的差別, 所謂入境隨俗這回事,盼君珍重。 -- String temp="relax"; | Life just like programing while(buringlife) String.forgot(temp); | to be right or wrong while(sleeping) brain.setMemoryOut(); | need not to say stack.push(life.running); | the compiler will stack.push(scouting.buck()); | answer your life stack.push(bowling.practice()); | Bone everything -- ※ 發信站: 批踢踢實業坊(ptt.cc) ◆ From: 220.134.27.68