第一个问题,你有一个数组;这里假如是a,其次,用这个语句
int i=(int)(Math.random()a.length);
System.out.println(a[i]);
第二个问题:
char i=(char)(Math.random()(‘z’-‘a’+1)+‘a’);
第三个问题:
String a=""+((char)(Math.random()*(‘z’-‘a’+1)+‘a’));
怎么随机的输出一个数组中的值?怎么随机输出字符型小写字母?怎么输出字符串型小写字母?
猜你喜欢
转载自blog.csdn.net/qq_43668119/article/details/85040532
今日推荐
周排行