Java Random randomLetter()

Here you can find the source of randomLetter()

Description

random Letter

License

Apache License

Declaration

public static char randomLetter() 

Method Source Code


//package com.java2s;
//License from project: Apache License 

import java.util.*;

public class Main {
    public static final char[] letters = { 'A', 'T', 'G', 'C' };
    public static Random rand = new Random();

    public static char randomLetter() {
        return letters[rand.nextInt(letters.length)];
    }/*from  w w w . j  a v a  2 s .  c  o m*/
}

Related

  1. randomIntegerList(int sz, int min, int max)
  2. randomIntegers(int sz)
  3. randomIterable(Collection col)
  4. randomKey()
  5. randomKey()
  6. randomList(Collection collection)
  7. randomMember(Collection collection)
  8. randomNanoTime()
  9. randomNick()