jeudi 1 avril 2021

need junit for random number generator

import java.util.Random;

/**

  • The Class RandomNumberGenerator. */ public class RandomNumberGenerator {

    /**

    • Instantiates a new random number generator. */ private RandomNumberGenerator() { }

    /**

    • Generate random number.
    • @return the int */ public static int generateRandomNumber() { Random random = new Random(); random.setSeed(System.currentTimeMillis()); return random.nextInt(9000) + 1000; } }



Aucun commentaire:

Enregistrer un commentaire