public String[] doSomething() {
String all = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ";
char[] allChars = all.toCharArray();
String[] result = new String[5];
Random random = new Random();
for(int i=0; i<result.length; i++) {
result[i] = new String();
for(int j=0; j<10; j++) {
int num = random.nextInt(allChars.length);
String charOne = String.valueOf(allChars[num]);
if(j%2 == 1) {
charOne = charOne.toUpperCase();
}
result[i] = result[i].concat(charOne);
}
//字符串反转
result[i] = new StringBuffer(result[i]).reverse().toString();
}
return result;
}
温馨提示:答案为网友推荐,仅供参考