samedi 17 avril 2021

Insert String elements of array into 2D array randomly Java

int[] howMany = {2, 3, 4};
String[] elements = {"🏠", "đŸŒŸ", "🌳"};
String[][] village = new String[3][3];

I'd like to create a 2D village array from the elements. In howMany array there are the numbers of the elements' occurrence. How can I randomly insert these elements (with maximum values in howMany) into the 2D array?




Aucun commentaire:

Enregistrer un commentaire