1
00:00:00,180 --> 00:00:05,730
Welcome back in the next couple of videos, we are going to look at collections and collections are

2
00:00:05,730 --> 00:00:09,750
simply a group of the same type of data or different type of data.

3
00:00:10,410 --> 00:00:16,050
So in Scotland, there are two categories of collections classes that can only hold one type of element

4
00:00:16,050 --> 00:00:22,650
of a particular data type and then classes that can hold both one type of element or a different type

5
00:00:22,650 --> 00:00:23,280
of element of.

6
00:00:25,050 --> 00:00:32,189
So each day that type in Scotland has a clause for holding its element into array is specifically for

7
00:00:32,189 --> 00:00:33,210
holding integers.

8
00:00:33,390 --> 00:00:40,650
Boolean array is used for holding true or false values, is used for holding double types than with

9
00:00:40,650 --> 00:00:43,150
byte array for holding byte values.

10
00:00:43,200 --> 00:00:48,360
And accordingly, then long and short range, while float array is specifically for holding float.

11
00:00:48,840 --> 00:00:52,860
So now you must be asking What about a string, for example?

12
00:00:53,430 --> 00:00:59,790
Well, there we have the array of which is a class that can hold all previously mentioned types, including

13
00:00:59,790 --> 00:01:06,030
strings and custom types or even classes, and can even hold different types together.

14
00:01:06,930 --> 00:01:11,790
So there are other classes like list or list of.

15
00:01:12,300 --> 00:01:14,280
Then we have set or set off.

16
00:01:14,640 --> 00:01:20,220
And finally, we have map and map of where a key is connected to a value.

17
00:01:20,520 --> 00:01:26,490
So these are our classes are not mutable, which means you can only read the values but cannot write

18
00:01:26,490 --> 00:01:26,850
to it.

19
00:01:27,540 --> 00:01:34,920
List is similar to an array of but with more helper methods for performing operations on its values,

20
00:01:35,280 --> 00:01:37,830
and the size can be easily increased when needed.

21
00:01:38,520 --> 00:01:45,660
So it is a class that ensures there are no duplicate values in a group, and map is arranged as a key

22
00:01:45,660 --> 00:01:49,290
value pair where each value has a key.

23
00:01:49,500 --> 00:01:51,450
You can use to identify it.

24
00:01:51,870 --> 00:01:57,960
So here, for example, the key one could be associated to Sun Key two for Monday and so forth.

25
00:01:58,710 --> 00:02:03,810
There are special classes for both reading and writing, and to a list set and map collections.

26
00:02:04,380 --> 00:02:11,730
This way, you can easily separate elements that need to be publicly modifiable from those that need

27
00:02:11,730 --> 00:02:12,480
to be private.

28
00:02:12,960 --> 00:02:17,670
All right, so now let's write some code and see how to use all of those different lists and collection

29
00:02:17,670 --> 00:02:18,060
types.

