All language subtitles for 046 Contacts – Part 4 (Solution)_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 Download
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
hu Hungarian Download
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

This video is going to cover the solution for part four, looking back at the requirements be classified,

another type of object, the contact manager and the contact manager as identified by the contacts that

it manages.

And it has two actions, adding and removing contacts.

We'll start by adding the contacts.

Field contact is plural, so it implies an array of Carra objects.

But we're going to use an array list because the number of elements can change.

As always of a class has failed, you need to apply the big three steps, we need to take instructor

at Getter and Setter.

The instructor is public shares the same name as the class, and it's going to receive no parameters

because in the beginning, the list of contacts is going to be empty.

We're just going to set the field equal to a new area list that can store contact objects.

Next, we want to get her gut contact that receives a one parameter.

The index of the contact object that they're trying to access.

In this letter is going to return a new copy of the contact object.

At the request, that index.

Next, we want to add a Seder that receives two parameters.

Contact object that you're going to use to update one of your Helmut's.

The index of the element that you want to update.

Then we're going to set the element at the requested index.

And set it equal to a new copy of the object being Pastan.

OK, that's all for the Big Three Steps.

Now we're going to get the method and contact, it's going to be void.

Receives one parameter, the contact they are trying to add.

And inside, we're going to insert a new copy of the contact object being Pastan.

The next action removes contact is also going to be void.

But it receives one parameter, the name of the contact that you want to remove.

So what we'll do is create a for loop that runs through the size of the array list.

Remember that array, less of a size, not a length and inside the loop.

We're going to get the contact object that every index I.

We'll get the name field of the contact and we'll check if it equals the name that was passed PASTAN

and if that's the case, then we're going to remove that contact from the aerialists.

Perfect.

We're done adding the big three steps, we added the two actions, the last thing we got to do is add

a two string method.

As always, public string to string.

I'm going to create a string named temp for a temporary it's going to be an empty string for now and

we'll return it's.

First will create a for loop that runs through the size of the aerialists.

And during each run, I'm going to get the two string of the contact object at the index I.

And then when I add that strength to the temp variable that we're returning.

And after adding the two string of a contact, we can add two lines so that we can separate it from

the next two string that gets passed into it.

And that's it now we're going to test our code.

Inside the workbook, I left you some values for objects that I want you to create.

First all, create an object of the contact manager class.

Manager is equal to a new object of the contact manager class.

And for the sake of expediency, I'm going to call that contact three times.

Once for Ryan.

Joe.

And Thomas.

Finally, we can print the contact to manager.

By printing the contract to manage our Java internally calls the two string method, which is going

to return a nicely formatted string of every contact and the contact lists.

Beautiful.

So the adduction works.

Now we're going to test the remove action, I'm going to remove the contact name Geo.

We run the up.

And everything works well.

This is the solution for part four.

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