148k views
3 votes
Briefly explain what an array is. As part of your answer make use of a labelled example to show the declaration and components of an array

User Bparise
by
5.2k points

1 Answer

3 votes

Answer:

Step-by-step explanation:

In programming an array is simply a grouping of various pieces of data. Various data elements are grouped together into a single set and saved into a variable. This variable can be called which would return the entire set which includes all of the elements. The variable can also be used to access individual elements within the set. In Java an example would be the following...

int[] myArray = {33, 64, 73, 11, 13};

In Java, int[] indicates that the variable will hold an array of integers. myArray is the name of the variable which can be called to access the array elements. The elements themselves (various pieces of data) are located within the brackets {}

User Kirill Groshkov
by
4.1k points