In previous example OBJECTS; we were making an inventory system. For an inventory system it is necessary to group objects, therefore we need this theory.
An array are boxes, in which you save data:
As you can see the boxes are empty.
To fill an array, you use this code:
arrayName [place in the array where you want to add] = object you want to add;
Using the previous inventory example (OBJECTS).
- First we’ve to create the object:
2. Then you can add the object, to the collection