Discuss / Java / Solution1

Solution1

Topic source

夜游蛇

#1 Created at ... [Delete] [Delete and Lock User]

import java.util.Arrays;

import java.util.Collections;

public class Solution1 {

    public static void main(String[] args) {

        Integer[] ns = { 1, 4, 9, 16, 25 };

        // 倒序打印数组元素:

        Arrays.sort(ns, Collections.reverseOrder());

        System.out.println(Arrays.toString(ns));

    }

}


  • 1

Reply