+ 2

What are arrays ?

1st Aug 2018, 5:31 PM
Ashish Ranjan
Ashish Ranjan - avatar
2 Answers
+ 1
I'll try to explain it as simple as possible. (Hopefully I'm right) It's a list of values. Like instead of saying a = "smth" you do a = ['smth0', 'smth1', 'smth2'] and then you access them like so x = a[0] In this case you assign a[0] which is 'smth0' to x Remember that arrays start from 0 and not 1! Edit: Example is written in Python.
1st Aug 2018, 5:53 PM
Apost
0
In java array is acollection of similar types of data with continous memory allocation. Java array is an object which contains elements of similar datatypes.
27th Feb 2019, 1:31 AM
Yogesh
Yogesh - avatar