Java Random Char randomChar(char[] letters)

Here you can find the source of randomChar(char[] letters)

Description

random Char

License

Open Source License

Declaration

private static char randomChar(char[] letters) 

Method Source Code


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

import java.util.Random;

public class Main {
    private static Random r = new Random();

    private static char randomChar(char[] letters) {
        int index = r.nextInt(letters.length);
        return letters[index];
    }//from   w w w. j a v a2  s  .  c  o m
}

Related

  1. randomChar()
  2. randomChar()
  3. randomChar()
  4. randomChar()
  5. randomChar()
  6. randomChar(Random r)
  7. randomCharacter(boolean includeSymbols)
  8. randomChars(char[] alphabet, int length)