Sorry, I'm totally new to Java maybe my question a bit stupid, but please help me. so, i have 2 arrays here:
char[] alphabet = {'A','B','C','D','E','F','G','H','I','J'
,'K','L','M','N','O','P','Q','R','S','T'
,'U','V','W','X','Y','Z'};
char[] numberArray = { '0', '1', '2', '3', '4', '5', '6', '7', '8', '9' };
and then I already merged both arrays in one new array then randomize it, and for example the output would be like:
4 Z B 8 R W P F T 1 D H S L Q 2 N J 5 6 V 3 A C 0 G K U E X 7 O Y M 9 I
The code I've written to merge two arrays is the following:
public static char[]merge(char[]alphabet, char[]numberArray){
char[] both = new char[alphabet.length+numberArray.length];
int i;
for(i=0; i<alphabet.length; i++)
both[i] = alphabet[i];
for(int j=0; j<numberArray.length; j++)
both[i++]=numberArray[j]; return both;
}
then from this output I wanna make all these elements into several 2D arrays with randomized elements. like this
G 4
7 Y
Or
H T
U 8
and so on.. how can i make the output like that? how to make it into 2x2 arrays?
oh, to make it clear, i wanna make it into more than 1 of 2x2 arrays, and generate it automatically, maybe I need loops to generate them.