如果想倒序,怎么用foreach实现?
import java.util.Arrays; public class HelloWorld { public static void main(String[] args) { int[] scores = { 89, 72, 64, 58, 93 }; System.out.print("正序输出:"); Arrays.sort(scores); for ( int score:scores) { System.out.print(score+" "); } } }