Welcome back in the next couple of videos, we are going to look at collections and collections are
simply a group of the same type of data or different type of data.
So in Scotland, there are two categories of collections classes that can only hold one type of element
of a particular data type and then classes that can hold both one type of element or a different type
of element of.
So each day that type in Scotland has a clause for holding its element into array is specifically for
holding integers.
Boolean array is used for holding true or false values, is used for holding double types than with
byte array for holding byte values.
And accordingly, then long and short range, while float array is specifically for holding float.
So now you must be asking What about a string, for example?
Well, there we have the array of which is a class that can hold all previously mentioned types, including
strings and custom types or even classes, and can even hold different types together.
So there are other classes like list or list of.
Then we have set or set off.
And finally, we have map and map of where a key is connected to a value.
So these are our classes are not mutable, which means you can only read the values but cannot write
to it.
List is similar to an array of but with more helper methods for performing operations on its values,
and the size can be easily increased when needed.
So it is a class that ensures there are no duplicate values in a group, and map is arranged as a key
value pair where each value has a key.
You can use to identify it.
So here, for example, the key one could be associated to Sun Key two for Monday and so forth.
There are special classes for both reading and writing, and to a list set and map collections.
This way, you can easily separate elements that need to be publicly modifiable from those that need
to be private.
All right, so now let's write some code and see how to use all of those different lists and collection
types.