Random Generators allow you to add randomness to your program. Regardless of what type of random object you want, you will first have to make a Random Generator:
RandomGenerator rgen = new RandomGenerator(); 

You can make many types of random objects using RandomGenerators. Here are some examples:
int randomInt = rgen.nextInt(); //Returns a random int double randomDouble = rgen.nextDouble(); //Returns a random double Color randomCol = rgen.nextColor(); //Returns a random color boolean randomBoolean = rgen.nextBoolean(); //Returns a random boolean