java生成一定范圍的隨機數(shù) java怎么使用隨機抽取數(shù)組里的數(shù)據(jù)?
java怎么使用隨機抽取數(shù)組里的數(shù)據(jù)?Random r=新建Random()系統(tǒng)輸出打?。╞)[r.nextInt(3)]r.nextInt(3)就是隨取得0 1 2這三個數(shù)(數(shù)學.隨機()*26 6
java怎么使用隨機抽取數(shù)組里的數(shù)據(jù)?
Random r=新建Random()系統(tǒng)輸出打?。╞)[r.nextInt(3)]r.nextInt(3)就是隨取得0 1 2這三個數(shù)(數(shù)學.隨機()*26 65)
字符c2=(字符)(int)(數(shù)學.隨機()*26 65)
字符c3=(字符)(int)(數(shù)學.隨機()*26 65)
int x1=(int)(數(shù)學.隨機()*10)
int x2=(int)(數(shù)學.隨機()*10)
int x3=(int)(數(shù)學.隨機()*10)
內(nèi)景x4=(內(nèi)景)(數(shù)學.隨機()*10)
系統(tǒng)打?。╟1)系統(tǒng)打印(c2)系統(tǒng)打?。╟3)系統(tǒng)打印(x1)系統(tǒng)打?。▁2)系統(tǒng)打?。▁3)系統(tǒng)打?。▁4)
}
}