What is array? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

What is array?

Can anyone explain the word Array to me? I don't understand.

12th Jul 2019, 3:30 PM
Samagidi Victor - Vikksy
Samagidi Victor - Vikksy - avatar
4 Answers
+ 1
Arrays are used to store multiple values in one, single variable. Declaring an array and defining the variable type stored in it: String [] fruits; Inserting values in it: String [] fruits = {"apple", "pear", "plum"};
12th Jul 2019, 3:38 PM
Lennie
Lennie - avatar
+ 2
Arrays are derived datatypes which are used to stores the values of variable similar datatypes. Arrays are also called linear data structure because in array the values or the data is stored one by one i.e. linearly. the arrays are accessed by their index ,the indexing starts from 0 i.e. if you want to store the value at 1st position then you have write the index at that position . Syntax (in c & c++)= data_type name[size]; example = int arr[10];
12th Jul 2019, 6:17 PM
Aadarsh Gupta
Aadarsh Gupta - avatar
+ 1
It's a series of elements of the same type
12th Jul 2019, 3:37 PM
Mina Yossry
Mina Yossry - avatar
+ 1
array stores elements, and you can address each of it if elements are numbers: array = {0,1,2,3,4,5} array[2] = 10 change element 2 in order (count from 0) to 10 now array = {0,1,10,3,4,5}
12th Jul 2019, 6:13 PM
zemiak