Here you can find the source of generateRandomNumber()
public static int generateRandomNumber()
//package com.java2s; /**/*from www . j a v a2 s . c o m*/ * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this file, * You can obtain one at http://mozilla.org/MPL/2.0/. */ import java.util.Random; public class Main { /** * Generate a random number between 5 to 16 * * @return */ public static int generateRandomNumber() { Random randomGenerator = new Random(); return randomGenerator.nextInt(11) + 5; } }