随机生成限定长度的账号

public static String createRandomNumber(int length) {
		String randomChars = "1234567890";
		StringBuffer buffer = new StringBuffer();
		buffer.append("1");
		for (int i = 0; i < length; i++) {
			int random = new Random().nextInt(10);
			buffer.append(randomChars.charAt(random));
		}
		return buffer.toString();
	}

你可能感兴趣的:(Android,服务器)