Is it possible to sort an array using Arrays.sort()
and thereafter have another related array positioned the same as the sorted array for example:
String arrNames[] = new String[5];
String arrCellNo[] = new String[arrNames.length];
String arrNamesSorted[] = new String[arrNames.length];
System.arraycopy(arrNames, 0, arrNamesSorted, 0, arrNames.length);
Arrays.sort(arrNamesSorted);
From this point what i would like to do is sort the CellNo
array such that if "person" had a cellNo "x", he will have the same "cellNo" "x" after the array arrNames
is sorted
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…