📜  创建一个随机字符 java 代码示例

📅  最后修改于: 2022-03-11 14:52:04.604000             🧑  作者: Mango

代码示例3
import java.util.Random;

public class RandomChar {
    public static void main(String[] args) {
        Random random = new Random();

        char randomizedCharacter = (char) (random.nextInt(26) + 'a');
        System.out.println("Generated Random Character: " + randomizedCharacter);

    }