Math.random()是令系統隨機選取大於等於0.0 且小於1.0 的偽隨機double 值,是Java語言常用代碼。例如:double a=Math.random()*(3-1)+1,設定一個隨機1到3的變數。
確定! 回上一頁