Afrikaans
Akan
Albanian
Amharic
Armenian
Azerbaijani
Basque
Belarusian
Bemba
Bengali
Bihari
Bosnian
Breton
Bulgarian
Cambodian
Catalan
Cebuano
Cherokee
Chichewa
Chinese (Simplified)
Chinese (Traditional)
Corsican
Croatian
Czech
Danish
Dutch
English
Esperanto
Estonian
Ewe
Faroese
Filipino
Finnish
French
Frisian
Ga
Galician
Georgian
German
Greek
Guarani
Gujarati
Haitian Creole
Hausa
Hawaiian
Hebrew
Hindi
Hmong
Hungarian
Icelandic
Igbo
Indonesian
Interlingua
Irish
Italian
Japanese
Javanese
Kannada
Kazakh
Kinyarwanda
Kirundi
Kongo
Korean
Krio (Sierra Leone)
Kurdish
Kurdish (Soranรฎ)
Kyrgyz
Laothian
Latin
Latvian
Lingala
Lithuanian
Lozi
Luganda
Luo
Luxembourgish
Macedonian
Malagasy
Malay
Malayalam
Maltese
Maori
Marathi
Mauritian Creole
Moldavian
Mongolian
Myanmar (Burmese)
Montenegrin
Nepali
Nigerian Pidgin
Northern Sotho
Norwegian
Norwegian (Nynorsk)
Occitan
Oriya
Oromo
Pashto
Persian
Polish
Portuguese (Brazil)
Portuguese (Portugal)
Punjabi
Quechua
Romanian
Romansh
Runyakitara
Russian
Samoan
Scots Gaelic
Serbian
Serbo-Croatian
Sesotho
Setswana
Seychellois Creole
Shona
Sindhi
Sinhalese
Slovak
Slovenian
Somali
Spanish
Spanish (Latin American)
Sundanese
Swahili
Swedish
Tajik
Tamil
Tatar
Telugu
Thai
Tigrinya
Tonga
Tshiluba
Tumbuka
Turkish
Turkmen
Twi
Uighur
Ukrainian
Urdu
Uzbek
Vietnamese
Welsh
Wolof
Xhosa
Yiddish
Yoruba
Zulu
1 1
Okay, I thought I'd do a brief video 2
2
on abstract data types because lists 3
3
is the first abstract data type 4
4
we're going to look at in the course. 5
5
So an abstract data type isn't a concrete data structure 6
6
in the sense that an array is. 7
7
It doesn't dictate how the data is organised. 8
8
With arrays, we know that we have to store 9
9
all the items as one contiguous blah 10
10
and arrays also dictate that every item in the array 11
11
has to occupy the same amount of memory. 12
12
So arrays are telling us how the data has to be stored 13
13
but lists don't do that. 14
14
Lists are more of a conceptual idea 15
15
and they dictate the operations we can perform 16
16
on the data set, not the items themselves. 17
17
An abstract data type doesn't do something 18
18
like say you can only multiply these items together, 19
19
it's more that it dictates how we can access the items. 20
20
Can we do random access? 21
21
Can we get to the first item that we added? 22
22
Can we get to the last item that we added? 23
23
And so, an abstract data type is more about behaviour 24
24
and what operations you can do. 25
25
Now in Java, a concrete data structure like an array 26
26
is usually a class. 27
27
Arrays might actually be an exception to that. 28
28
So you'll see as we go through the course 29
29
and we look at other concrete data structures, 30
30
there's usually a class for them in the JDK. 31
31
When it comes to an abstract data type, 32
32
normally those are interfaces, which makes sense right? 33
33
Because they're not telling you how to store the data, 34
34
they're specifying behaviour and that's 35
35
commonly done with an interface. 36
36
And so basically, any data structure can be used 37
37
to implement an abstract data type, 38
38
as long as you have a class that implements the interface 39
39
for the abstract data type, 40
40
any class can behave like that abstract data type. 41
41
So in the case of lists, any class that implements 42
42
the list interface, is a list 43
43
and so you could have a class that uses 44
44
an array for the list. 45
45
If that class implements the list interface, 46
46
it can be treated like a list. 47
47
You could have a class, 48
48
this would be a terrible thing to do, 49
49
but you could have a class that has individual fields 50
50
for every item in the list. 51
51
As long as that class implements the list interface, 52
52
it's a list. 53
53
You can treat it like a list. 54
54
And so when it comes to an abstract data type, 55
55
they're not concrete data structures, 56
56
they don't dictate how the data can be stored, 57
57
but they do dictate the operations you can do 58
58
on the abstract data type. 59
59
So for example with lists, let's say you can add an item, 60
60
you can remove an item, 61
61
you can get the index of an item, et. Cetera, 62
62
but they don't say and this is the way 63
63
you have to store the items in the list. 64
64
They don't say that. 65
65
So now that we have some idea what an abstract dat type is, 66
66
let's move on to looking at list in the JDK. 67
67
I'll see you in the next video.
Can't find what you're looking for?
Get subtitles in any language from opensubtitles.com, and translate them here.