Code example for Random

Methods: nextInt

0
 
	//--------------------------------------------------------------------------- 
 
	public char getRandomChar() 
	{ 
		int pos = RANDOM.nextInt() * 62; 
 
		if (pos <26) 
			return (char) ('a' + pos); 
 
		pos -= 26; 
 
		if (pos <26) 
			return (char) ('A' + pos); 
 
		pos -= 26; 
 
		return (char) ('0' + pos); 
	}