运行结果出不来,是3个[I@140e19d
/** * Created by Administrator on 2017/8/25. */ import java.util.Arrays; public class Tex1 { public static void main(String[] args) { int[] chengji = new int[]{9, -23, 64, 91, 119, 52, 73}; Tex1 hello=new Tex1(); hello.Top3(chengji); } public void Top3(int chengji[]) { Arrays.sort(chengji); int num = 0; for (int i = chengji.length - 1; i >= 0; i--) { if (chengji[i] < 0 || chengji[i] > 100) { continue; } num++; if (num > 3) { break; } System.out.println(chengji); } } }