android中的排序字符串[]?

android中的排序字符串[]?,android,Android,如何排序此数组。任何人请帮助我。请尝试下面的代码 按升序排序数组 按降序排列数组 String[] names = { "Capacitance", "Current", "Capacitive Reactance", "Energy", "Frequency", "Inductance", "Inductive Reactance", "Power", "PowerFactor Angle", "RealPower", "ReactivePowe

如何排序此数组。任何人请帮助我。

请尝试下面的代码

按升序排序数组

按降序排列数组

String[] names = { "Capacitance", "Current", "Capacitive Reactance",
            "Energy", "Frequency", "Inductance", "Inductive Reactance",
            "Power", "PowerFactor Angle", "RealPower", "ReactivePower",
            "Resistance", "SysytemFrequency", "Voltage" };
Arrays.sort(names);
Arrays.sort(names, Collections.reverseOrder());