Q:

Java array sort (array1 (key), array2 (value))

I'm trying to do what in C# into Java. In C#:
Array.sort(array1, array2);

Where array1 is key and array2 is value
https://msdn.microsoft.com/en-us/library/85y6y2d3(v=vs.110).aspx
Was wondering if Java has something like that as well built in or we have to do some sort of customization.

A:

Nothing as trivial, but converting to a TreeMap, which is automatically sorted, is likely the best way to go:
Map<String, int> map = new TreeMap<String, int>();

for (var i = 0; i < array1.length; i++)
    map.put(array1[i], array2[i]);

To iterate:
for (Map.Entry<String, int> entry : map.entrySet()) {
    // do stuff
}

