// math.random()范围是[0.0,1.0),那么math.random()*9+1一定是小于10的,// (Math.random()*9+1)*100000一定是<10*100000=1000000的一个数String code=(int)((Math.random()*9+1)*100000)+"";