Do I use an array to keep values, or just individual values for things like skill points. | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 5

Do I use an array to keep values, or just individual values for things like skill points.

I'm wondering if you would use an array to organize values like skill points, or to just store them in individual values?

23rd May 2018, 11:35 AM
Archie
Archie - avatar
4 Answers
+ 1
Arrays are very good for storing data of similar type. You could use integer arrays. It will be easier to access also. If you have like 50 peoples skill points. Making 50 variable for one purpose doesn't seem like a great idea.
23rd May 2018, 11:38 AM
Akib
Akib - avatar
+ 2
Ok, thanks. I was thinking of only storing individual arrays. Storing 50 arrays in one array is excessive. Maybe add the arrays to a list if it comes about. But this is what I needed.
23rd May 2018, 11:44 AM
Archie
Archie - avatar
+ 2
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!"
23rd May 2018, 11:58 AM
Andrew Watts
Andrew Watts - avatar
0
I would use an array with the skills as indexers.
24th Jul 2019, 8:20 PM
Epameinontas Athanasopoulos
Epameinontas Athanasopoulos - avatar