随机问题 比如我有10个数,想从中随机取5个数出来,进行操作(如打印)。求一个方法。谢谢! 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 public class abc{ public static void main(String [] args) { int [] shuzu = {10,20,30,40,50,60,70,80,90,100}; int [] jj = {100,100,100,100,100}; int count=0; while(count<5) { int j = 0 ; while(true) { boolean found = false; j = (int)(Math.random()*10); System.out.println(">>>>>"+j); for(int i = 0 ;i<=count;i++) { if(jj[i]==j) found = true ; } if(! found) { jj[count] = j; count++; break; } } System.out.println(shuzu[j]); } }} 我的Jtable为什么不能跟窗体大小而改变 大家好,本人辞去GUI版主职务,感谢大家的支持 java 1.5 的线程 线程 在线等 没分了,希望好心帮助下 2个ArrayList的问题 关于jdk和tomcat配置的一些疑问? 请各位大虾说说有什么好的学习JAVA和JBUILDER的电子书 疑问 我下载了java开发大全这本电子书,解压后,所有的文件名是: Jackson PK Gson 特急 线程的run() 函数 和 canvas的update() 函数 关于Runtime.process()的问题
{
public static void main(String [] args)
{
int [] shuzu = {10,20,30,40,50,60,70,80,90,100};
int [] jj = {100,100,100,100,100};
int count=0;
while(count<5)
{
int j = 0 ;
while(true)
{
boolean found = false;
j = (int)(Math.random()*10);
System.out.println(">>>>>"+j);
for(int i = 0 ;i<=count;i++)
{
if(jj[i]==j) found = true ;
}
if(! found)
{
jj[count] = j;
count++;
break;
} } System.out.println(shuzu[j]);
}
}
}