i made this code to loop number
for(int i=0;i<4;i++){
double temp[i]=Math.random() * i*10;
system.out.println("Result" +i+ "=>" +temp);
}
output :
Result 0 => 14.3
Result 1 => 11.4
Result 2 => 10.8
Result 3 => 12.4
now, i want to sort by ascending this output based on value with keep original index, so the output like this :
Result 2 => 10.8 => 1
Result 1 => 11.4 => 2
Result 3 => 12.4 => 3
Result 0 => 14.3 => 4
how to do this?