Some basic concepts of arrays

Source: Internet
Author: User

1. An array is made up of a set of variables of the same type, which are represented by a common name. The array is divided into one-dimensional, two-dimensional and multidimensional arrays according to the complexity of the storage elements.

2. Using an array in Java must go through the declaration array and open up memory to the two steps of the array. Declaring an array will open up space in the stack memory and point to the heap memory space to use, and you can use the New keyword to open up the heap memory space while specifying the amount of space to open.

3. In Java to get the length of the array (that is, the number of elements), you can use. length to complete.

4. Array access to use subscript, if the subscript is accessed beyond the scope of the array, an array out-of-bounds exception occurs.

5.Java allows each row in a two-dimensional array to have a different number of elements.

6. The passing of an array is a pass of the reference data type, passing the use of the heap memory address, an array can have multiple names pointing to the same heap memory space, and each name can modify the contents of the heap memory.

7. After JDK5.0 The new Java feature, the main function is to easily output the contents of the array.

Some basic concepts of 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.