So i am making a program that needs to handle multiple arrays. Is there any way to sort all these arrays to reflect the sorting of one array? These values are at the same index position across all three arrays and need to stay at the same index value after sorting
Example:
I have three arrays:
String[] distance = [1,3,6,7,9];
String[] name = [Joel, John, Joe, Jill, Jane]
String[] values = [1.5,2.3,5.6,7.1,6.5];
Is there any way to sort the distance array and then reflect that sorting to the other arrays. So if I sort by name and Jane becomes 0, the other values at the same positions in the other arrays will also move to 0. How could I do this?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…