Check (various methods)
1) Iterate through the array (check all data)
1. Using the method provided by the JDK (take doctrine: almighty Baidu)
1. The ToString (array name) method of the arrays class to output all the data in the array
2. 自己编码(还是提倡吧,有益大脑,实际开发就拿来主义吧!) 1. 依次获取数组中的数据,对于这种重复性操作可以使用循环来完成 2. 语法 ![](https://images2018.cnblogs.com/blog/1009428/201808/1009428-20180826151407315-126747851.png)
2) Find the extremum (check maximum and minimum value)
1. Using the method provided by the JDK (take doctrine: almighty Baidu)
Arrays.steam (array name). Max () or. min (). Getasint ()
Arrays.sort(数组名);然后根据下标找极值,缺点是"改变了数组中元素顺序" ![](https://images2018.cnblogs.com/blog/1009428/201808/1009428-20180826151431396-377784108.png) 2. 自己编码(先假定数组中下标为0的为极值,然后依次与其它数比较,找到真正极值后重新赋值给变量即可) ![](https://images2018.cnblogs.com/blog/1009428/201808/1009428-20180826151436443-1269879976.png)
3) sort (ascending)
1. Using the method provided by the JDK (take doctrine: almighty Baidu)
Arrays.sort (array name), need to import java.util.Arrays
2. 自己编码 选择排序(选择数组中第一个数,然后依次与后面的数比较,把最小的放前面,最大放后面) ![](https://images2018.cnblogs.com/blog/1009428/201808/1009428-20180826151512161-1987488509.png) 冒泡排序(相信元素比较,小的排前,大的排后) ![](https://images2018.cnblogs.com/blog/1009428/201808/1009428-20180826151516791-392512180.png) ![](https://images2018.cnblogs.com/blog/1009428/201808/1009428-20180826151523112-1052283852.png)
4) Invert (descending)
1. So simple, no API, write it Yourself
1. Use a loop to remove from an array and then write to another array, paying attention to the transformation of the subscript (two ways)
2. 如果,反转前是升序,那么反转后就是降序了
5) Find the subscript of an element in the array (whether or not an element exists)
1. Use the API (is a sorted subscript, but you can sort whether the element exists)
2. 自己编码(使用循环依次遍历) ![](https://images2018.cnblogs.com/blog/1009428/201808/1009428-20180826151543198-1424150428.png)
6) Other operations
1. Copy the specified range of the specified array to a new array. Contains the starting position but does not contain the end position
1. Arrays.copyofrange (int[] arr,int from,int to); its return value is an array
2.