评论 来源:互联网 时间:2023-04-24 06:41:25
(资料图片仅供参考)
1、1.新建一个类:TestSortPartOfArray.java
2、2.声明一个数组:array,它包含几个元素。
3、3.定义两个参数fromIndex和toIndex,分别代表要排序的数组的起点和终点。
4、4.调用Array的sort方法进行排序,参数传递如下。
5、5.排序后打印数组
6、6.运行程序时,可以看到位置0-6的元素被排列,其他位置的元素保持不变(6本身不排序)。
本文到此结束,希望对大家有所帮助。
标签:
下一篇:最后一页
23-04-23
23-04-23
23-04-23
23-04-23
23-04-23
23-04-23
23-04-23
23-04-23
23-04-23
23-04-23
23-04-23
23-04-23
23-04-23
23-04-23
23-04-23
23-04-23
23-04-23
23-04-23
23-04-23
23-04-23
23-04-23
23-04-23
23-04-23
23-04-23
23-04-23
23-04-23
23-04-23
23-04-23
23-04-23
23-04-23
23-04-23
23-04-23
23-04-23
23-04-23
23-04-23
23-04-23
23-04-23
23-04-23
23-04-23
23-04-23
23-04-23
23-04-23
23-04-23
23-04-23
23-04-23
23-04-23
23-04-23
23-04-23
23-04-23
23-04-23
23-04-23
23-04-23
23-04-23
23-04-23
23-04-23
23-04-23
23-04-23
23-04-23
23-04-23
23-04-23
22-09-30
22-04-11
22-04-11
22-04-11
22-04-11
22-04-11
22-04-11
22-04-11
22-04-11
22-04-11
23-04-23
23-04-23
23-04-23
23-04-23
23-04-23
23-04-23
23-04-23
23-04-23
23-04-23
23-04-23