All language subtitles for 022 Polymorphism in Lists_en

af Afrikaans
ak Akan
sq Albanian
am Amharic
ar Arabic
hy Armenian
az Azerbaijani
eu Basque
be Belarusian
bem Bemba
bn Bengali
bh Bihari
bs Bosnian
br Breton
bg Bulgarian
km Cambodian
ca Catalan
ceb Cebuano
chr Cherokee
ny Chichewa
zh-CN Chinese (Simplified)
zh-TW Chinese (Traditional)
co Corsican
hr Croatian
cs Czech
da Danish
nl Dutch
en English
eo Esperanto
et Estonian
ee Ewe
fo Faroese
tl Filipino
fi Finnish
fr French
fy Frisian
gaa Ga
gl Galician
ka Georgian
de German
el Greek
gn Guarani
gu Gujarati
ht Haitian Creole
ha Hausa
haw Hawaiian
iw Hebrew
hi Hindi
hmn Hmong
is Icelandic
ig Igbo
id Indonesian
ia Interlingua
ga Irish
it Italian
ja Japanese
jw Javanese
kn Kannada
kk Kazakh
rw Kinyarwanda
rn Kirundi
kg Kongo
ko Korean
kri Krio (Sierra Leone)
ku Kurdish
ckb Kurdish (Soranรฎ)
ky Kyrgyz
lo Laothian
la Latin
lv Latvian
ln Lingala
lt Lithuanian
loz Lozi
lg Luganda
ach Luo
lb Luxembourgish
mk Macedonian
mg Malagasy
ms Malay
ml Malayalam
mt Maltese
mi Maori
mr Marathi
mfe Mauritian Creole
mo Moldavian
mn Mongolian
my Myanmar (Burmese)
sr-ME Montenegrin
ne Nepali
pcm Nigerian Pidgin
nso Northern Sotho
no Norwegian
nn Norwegian (Nynorsk)
oc Occitan
or Oriya
om Oromo
ps Pashto
fa Persian
pl Polish
pt-BR Portuguese (Brazil)
pt Portuguese (Portugal)
pa Punjabi
qu Quechua
ro Romanian
rm Romansh
nyn Runyakitara
ru Russian
sm Samoan
gd Scots Gaelic
sr Serbian
sh Serbo-Croatian
st Sesotho
tn Setswana
crs Seychellois Creole
sn Shona
sd Sindhi
si Sinhalese
sk Slovak
sl Slovenian
so Somali
es Spanish
es-419 Spanish (Latin American)
su Sundanese
sw Swahili
sv Swedish
tg Tajik
ta Tamil
tt Tatar
te Telugu
th Thai
ti Tigrinya
to Tonga
lua Tshiluba
tum Tumbuka
tr Turkish
tk Turkmen
tw Twi
ug Uighur
uk Ukrainian
ur Urdu
uz Uzbek
vi Vietnamese
cy Welsh
wo Wolof
xh Xhosa
yi Yiddish
yo Yoruba
zu Zulu

Original subtitles

Many collection types implement the list interface.

For example, Array List implements the list interface.

Linked list implemented as well, and there are other classes that we're not going to cover.

So in this lesson, you're going to see polymorphism from classes that implement list.

Open the folder for this lesson by following this path in your course resources.

Now, list is an interface that defines methods a class must implement.

The array list class implements this interface, it also implements a bunch of other interfaces, inherits

from a class, but we don't care about that.

Let's just focus on the fact that array list implements the list interface.

Here are some of the methods that list the fines, this one should be familiar to you, size array list

implements this interface.

So we know the array list class overrides this method.

You can go back here and call size from this array list.

Here's another one is empty, and it follows that we can call is empty.

Contains a list, definitely overrides, contains, because we've used it so many times before it.

Anyways, you get the points, the array list class implements this interface, so it's basically signing

a contract that it's going to override all of the methods inside this interface and it does.

For example, we know our array list is going to be forced to override array.

Let's start to Iraq, which returns an array from the array list.

Now, linked list is another collection type, it also implements the list interface.

Because linked list implements list, it also signs a contract that it's going to override all of the

methods inside list.

We can create a linked list collection in much the same way linked list that can store energy objects

list to.

Is equal to a new object of the limitless class.

And because the linked list class implements the list interface, we know it's going to be forced to

override all of these methods.

So all the same, we can call at least to add a lot, a few numbers.

We can call list to size.

List that is empty.

List contains.

Listen to not Iraq.

All right, so what's the difference between a relist and linked list, performance wise linked list

is almost always the wrong choice.

If you look at the documentation array list is usually faster.

Array list offers a faster way of accessing elements because it has direct references to every element,

whereas with a linked list, it has to go through every single element in the list until it gets to

the element that you're trying to access.

So it's a lot slower when you're trying to access values.

In this course, we're going to stick to using a realist.

Now, what's interesting is that remember that interfaces allow for polymorphism because array list

implements the list interface.

We can declare the object type list.

Same thing here, we can declare the linked list as type list.

Why is polymorphism important?

Same reason as always, flexibility, if I declare this type list, then I can easily switch between

array list and linked list.

I like to just stick to our list now, all I want you to take away from this lesson is that array list

and linked list can take the form of the interface they implement.

Let's recap array list and linked list, implement the list interface.

List is an interface that defines method's a class must implement.

In other words, each class signed a contract to override every method inside the lowest interface.

Each one of them overrides these methods in a different way.

But in general, performance was linked.

List is almost always the wrong choice.

In this course, we're going to stick to using a realist.

And because each class implements the interface, we can see polymorphism, you can declare the array

list as type list Auris type array list, and you can also declare a linked list as its own type or

type list.

Can't find what you're looking for?
Get subtitles in any language from opensubtitles.com, and translate them here.