Java Random Char randomChar()

Here you can find the source of randomChar()

Description

random Char

License

Open Source License

Declaration

private static char randomChar() 

Method Source Code


//package com.java2s;
//License from project: Open Source License 

import java.util.Random;

public class Main {
    private static final Random random = new Random(17);
    private static final String alphabet = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz";

    private static char randomChar() {
        return alphabet.charAt(random.nextInt(alphabet.length()));
    }//from   w w  w .  j  a  v  a2  s  .c o m
}

Related

  1. getRandomChar(Random random, int type)
  2. getRandomCharacter()
  3. getRandomCharacter()
  4. randomChar()
  5. randomChar()
  6. randomChar()
  7. randomChar()
  8. randomChar(char[] letters)
  9. randomChar(Random r)