# 生成随机字符串

生成一个由大写字母和数字组成的6位随机字符串，并且字符串不重复

## template

```java
class java_384519 {
	public static char[] generate() {
	char[] letters = { 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S',
		'T', 'U', 'V', 'W', 'X', 'Y', 'Z', '0', '1', '2', '3', '4', '5', '6', '7', '8', '9' };
	boolean[] flags = new boolean[letters.length];
	char[] chs = new char[6];
	for (int i = 0; i < chs.length; i++) {
	  int index;
	  do {
		index = (int) (Math.random() * (letters.length));
	  } while (flags[index]);
	  chs[i] = letters[index];
	  flags[index] = true;
	}
	return chs;
  }
}
```

## 答案

```java

```

## 选项

### A

```java

```

### B

```java

```

### C

```java

```