+ 3
Can anyone Explain me the concept of arrays in simple ??
2 ответов
+ 4
It is just a series of variables combined together under one name, typically they're related to one another in some form. You access the individual variables within the array by referencing the array's name and specify its index.
EXAMPLE:
String[] cars = new String[3];
cars[0] = "Honda";
cars[1] = "Ford";
cars[2] = "Kia";
System.out.println(cars[1]); // output is Ford
System.out.println(cars[0]); // output is Honda
for(String car : cars){
System.out.println(car + " ");
} // output is Honda Ford Kia
You didn't say what language you're working with, but the concept is pretty much the same between them, though the syntax is different between some of them.
0
[DUPLICATE QUESTION]