How to use java.util.Arrays

后端 未结 5 1527
挽巷
挽巷 2021-01-02 09:03

I\'m trying to use the java.util.Arrays class in JavaSE 6 but not sure how i would implement it? on an array that I have generated?

before the start of the class i

5条回答
  •  伪装坚强ぢ
    2021-01-02 09:52

    public static void main(String[] args) {
    
    double array[] = {1.1,2.3,5.6,7.5, 12.2, 44.7,4.25, 2.12};
    Arrays.sort(array,1,3); 
    for(int i =0;i 

    result:

    "1.1,2.3,5.6,7.5,12.2,44.7,4.25,2.12"

提交回复
热议问题