Here you can find the source of randomAge()
public static int randomAge()
//package com.java2s; //License from project: Apache License import java.util.concurrent.ThreadLocalRandom; public class Main { private static final int MAX_AGE = 120; private static final ThreadLocalRandom random = ThreadLocalRandom .current();//from w w w .j a va2 s. c o m /** * Random age. * * @return the integer */ public static int randomAge() { return random.nextInt(MAX_AGE); } }