0 votes
in JAVA by
What is array in java?

1 Answer

0 votes
by

An array is a container object that holds a fixed number of values of a single type. The length of an array is established when the array is created. After creation, its length is fixed. You have seen an example of arrays already, in the main method of the “Hello World!” application. This section discusses arrays in greater detail.

Array of 10 boxes numbered 0 through 9; an index of 0 indicates the first element in the array.

An array of 10 elements.

Each item in an array is called an element, and each element is accessed by its numerical index. As shown in the preceding illustration, numbering begins with 0. The 9th element, for example, would therefore be accessed at index 8.

Related questions

0 votes
asked Oct 20, 2020 in JAVA by sharadyadav1986
+1 vote
asked Oct 24, 2020 in JAVA by sharadyadav1986
...