Java Learning Note--arrays

Source: Internet
Author: User
Arrays Common methods

Arrays.tostring (int[] a) method-------> Return type is string, which can be used to produce a printable representation of an array, avoiding the use of loops to read the array values sequentially to print

Arrays.sort (int[] a) method-------> used to sort the array

Arrays.fill (int[] A, int val) method-------> used to populate an array with a Val value

Arrays.copyofrange (int[] original, int from, int to) method-------> Copy an array from the from (including) to the to (not included) position

Arrays.copyof (int[] original, int newlength) method-------> truncate or enrich array (complement 0)

Arrays.binarysearch (int[] A, int key) method-------> Find key using binary method

Arrays.aslist (T ... a) method-------> Converts a Continuous object or base type to a list, such as Arrays.adlist (1,2,3,4), but in this case the underlying representation is an array, so the dimension cannot be resized. If you try to add a delete element by using either the Add () or delete () method, you get a "unsupported operation" error.

See the API documentation for specific usage.

Java Learning Note--arrays

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.