看板 [ java ]
討論串[問題] 隨機產生列舉物件的方法?
共 3 篇文章
首頁
上一頁
1
下一頁
尾頁

推噓1(1推 0噓 0→)留言1則,0人參與, 最新作者godfat (godfat 真常)時間18年前 (2007/08/28 17:49), 編輯資訊
0
0
0
內容預覽:
^^^^^^^^. 我不知道有 values 這種東西,用 reflection 硬幹了一份 XD. 只是覺得 java 檢查實在是有夠嚴格,應該不會有錯的地方也要聲明. 流程也在 compile time 檢查﹍. import static java.lang.System.out;. impo
(還有1124個字)

推噓2(2推 0噓 0→)留言2則,0人參與, 最新作者kennyliao (aggressive)時間18年前 (2007/08/28 17:17), 編輯資訊
0
0
0
內容預覽:
原文恕刪. 改寫您的 a_random_modifier method. public Modifier a_random_modifier() {. int index=(int)(Math.random()*Modifier.values().length);. return Modifier.

推噓7(7推 0噓 0→)留言7則,0人參與, 最新作者H45 (!H45)時間18年前 (2007/08/28 16:40), 編輯資訊
0
0
0
內容預覽:
我想要亂數產生下面的列舉物件:. public enum Modifier {. NORMAL (1.0),. VERY(2.0),. MORE_OR_LESS(0.5);. private final double value;. private LinguisticModifier(double
(還有513個字)
首頁
上一頁
1
下一頁
尾頁