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 

public class Main {
    private static char randomChar() {
        int num = (int) Math.floor(Math.random() * 60);
        if (num < 26)
            return (char) ((int) 'a' + num);
        num -= 26;//from   www  .  j av a2  s . c  o  m
        if (num < 26)
            return (char) ((int) 'A' + num);
        num -= 26;
        if (num < 1)
            return '\n';
        return ' ';
    }
}

Related

  1. getRandomChar(int[][] ranges, char differentThen, boolean caseSensitive, Random random)
  2. getRandomChar(Random random, boolean upper)
  3. getRandomChar(Random random, int type)
  4. getRandomCharacter()
  5. getRandomCharacter()
  6. randomChar()
  7. randomChar()
  8. randomChar()
  9. randomChar()