Simple use of java.util.Arrays

Array tools

  Array operation provides several tools method

    Arrays.toString(a)

   The data in the array, a connection to a string

   "[Value 1, value 2 and value 3, value 4]"

 

    Arrays.sort(a)

    Sorting an array

   Quick Sort primitive array optimization

   Merge sort array of reference types, optimized

 

Arrays.binarySearch(a, t)

A binary search, binary search

In an ordered array, subscript find the target location,

Can not find, return - (insertion point +1)

 

 Arrays.copyOf (a, specified length)

The array, into a new copy of the specified array length

Guess you like

Origin www.cnblogs.com/l-x-x-y-d-j/p/11332272.html