Summary

Watch the YouTube video

So, we learned that:

  • an array is a bunch / group / collection of variables that are treated as one object;
  • to create an array you need to:
    • declare a reference variable that points to the array
    • and create the array object itself;
  • you can specify how big you want your array to be.

When to use arrays?

The array is amazing for storing a fixed list of values. It has a fixed length to work with, and this might be the problem. 😅

Why using arrays?

Arrays are useful because they provide the ability to store instances of the same type and at the same time manipulate individual items.

What are the drawbacks?

These are the drawbacks for arrays:

  • once you create an array, you can't change its length (fixed size);
  • you must know in advance how many elements are in an array;
  • you can't dynamically allocate memory (dynamic allocation);
  • the elements of an array are stored in consecutive memory locations which means that insertion and deletion operations are very difficult and time consuming;
  • arrays are useful, but they are a bit “old-school” in their style.

Bye

Thanks for your time 😄

Nick bye

Giphy