我是java新手。我大约在 3 天前开始。我想制作一行随机字符并将它们放入一个字符串中。谢谢你。
import java.util.Random;
public class test{
public static void main (String[]args){
final String alphabet = "abcdefghigklmnopqrstuvwxyz";
final int N = alphabet.length();
Random r = new Random();
for (int i = 0; i < 50; i++) {
String s = alphabet.charAt(r.nextInt(N));
// System.out.println(alphabet.charAt(r.nextInt(N)));
}}}