ARRAYS function

xiaoxiao2021-03-06  80

Java.util.Arrays is an unforgable application class that provides general operations for array, and array types can be basic types and reference types.

Sort Sort

For basic types, it is relatively small.

For reference types, you can specify a Comparer in accordance with natural order (implemented Comparable interface).

2. Find binarysearch

The array must be sorted, otherwise the method is not defined.

3. Plip Fill

That is to fill some elements of an array with a value.

4. Compare two arrays Equals

Currently only when the length of the array length and each position are equal, etc.

5. Convert to LIST

Public Static List aslist (Object [] a)

Returns a list that contains all elements in an array.

Here, it is, Fill and Equals are overloaded in the basic types and objects, but sort and binarysearch.

There is no reload to Boolean, and the entire implementation is very simple.

转载请注明原文地址:https://www.9cbs.com/read-107793.html

New Post(0)