Detailed description of the Length attribute of the array -- Java

Source: Internet
Author: User
Detailed description of the Length attribute of the array

1. the length in the array refers to the number of elements in the array. For example, there are 6 elements in array A, and the last element is a [5], length = 6; 2. when defining an array, specify the length of the number of array elements. For example, int [] A = new int [length]. See the following. Source code : Public   Class   Test { Public   Static   Void   Main (string [] ARGs ){   //   Todo   Auto-generated method stub   Int   Length = 10;   Int [] A =   New   Int [Length]; System.   Out . Println ( "A. Length =" +. Length ); // Output': A. Length = 10 } }

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.