Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我有一个数组可以说有值
Char Arr[] ={A,B,A,C,D,B,A,F,G,B,A};
我想以形式对这个数组进行排序
Arr[] = {A,A,A,A,B,B,B,C,D,F,G}
请告知如何在java中实现这一点,..!!
尝试使用方法 sort()..
Arrays.sort(Arr);
有一个Arrays.sort()方法可以为您完成工作。
这将按顺序对您的对象进行排序,没有返回类型,因为引用的副本被传递并用于操作数组。