samedi 18 août 2018

How to fill an array with random numbers and freeze/safe the numbers inside of the Array

I have a question how can I fill an Array with Random numbers and than save the numbers inside the Array and don't random again here is my code

public static void main (String[] args){
    int[] Array = new int [10] ;
    for (int i = 0; i < Array.length; i++){
      Array[i] = (int) (Math.random() * 100);
      System.out.println(Array[i]);
    }

}

thank you very much




Aucun commentaire:

Enregistrer un commentaire