Common method of Java Arrays

  1. Arrays.toString (Object [] a) an array of printing
  2. Arrays.asList (Object [] a) converting the array into ArrayList
  3. Arrays.sort (Object [] a) to sort the array
  4. Arrays.binarySearch (Object [] a, Object key) using a binary search element index
  5. Arrays.copyOf (Object [] original, int newLength) copy the array, and the specified length
  6. Arrays.copyOfRange (Object [] original, int from, int to) copy the array, and specifies the start / end index (end not included)
  7. Arrays.fill (Object [] a, Object val) to specify a packed array element
Published 163 original articles · won praise 13 · views 3788

Guess you like

Origin blog.csdn.net/qq_42174669/article/details/104883929