All language subtitles for 014 Enum_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

An item contains a limited number of constants.

Using enum to ensure something can only be a limited number of values.

In this lesson, you're going to create an enum.

An enum defines a collection of static final constants.

Using Inam to ensure a variable can only be a limited number of values.

The size of a shirt should be limited to three values, small, medium or large.

But what if the caller writes something like Wambo?

They surely can assizes of type string so it can be anything.

Then you might think that's OK.

We could just apply exception handling if the caller writes anything bad.

Yeah, but why do any of that?

From the start, we just use an item to insure this variable can only be a limited number of values.

So inside the shirt class, we're going to create a public item called size that defines three static

final constants, small, medium, large.

This is how you create an item.

All you have to do is make sure to always capitalize constants inside of an item now by default, every

value inside of an enormous final.

These values can never be changed.

Basically, an item is just a collection of final values.

OK, now the problem with the size is that it's a strength, which means it can be any type of value,

we're going to make it an enum type so that it's limited to only three.

And now the constructor needs to receive an item constant.

And now you're going to have to regenerate the getters and setters.

Now, back in Maine, an enum is implicitly static, that means we can access it directly from the class.

And now I can only give the shirt one of three values, small, medium or large, I'm going to give

it a size of small.

And now I can print the object.

And everything works beautifully.

You limited the size field to three possible values.

Use an enum to ensure something can only be a limited number of values.

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