日期:2014-05-20 浏览次数:20761 次
public class AppClass {
public static void main(String[] args)
{ TestClass test = new TestClass();
for(int i = 0 ;i<10;i++){
String str = test.get(10);
System.out.println(str);
}
}
}
public class TestClass {
public String get(int len)
{
String str = "";
try {
Thread.sleep(20);
} catch (InterruptedException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
Random r = new Random(System.currentTimeMillis());
Random r2 = new Random(System.currentTimeMillis());
int len2 = r.nextInt(len);
for(int i=0;i<len2;i++)
{
int a = r.nextInt(10);
String s = Integer.toString(a);
str += s;
}
return str;
}
}