public static void main(String[] args) {int[] a = {5,2,33,31,54};Dome01 test = new Dome01();System.out.println(test.and(a));}public int[] and(int[] array){Arrays.sort(array);return array;}运行结果:[I@19e0bfd
1 回答
晒星星
TA贡献1条经验 获得超0个赞
//遍历一下数组a输出,在输出试试
public static void main(String[] args) {
int[] a = { 5, 2, 33, 31, 54 };
Dome01 test = new Dome01 ();
test.and(a);
for (int i = 0; i < a.length; i++) {
System.out.print(a[i] + ",");
}
}
public int[] and(int[] array) {
Arrays.sort(array);
return array;
}
添加回答
举报
0/150
提交
取消