All language subtitles for 013 Built-in Functions_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
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

Java has so many built in functions.

In this lesson, you're going to look at some examples of built in functions.

First thing I'll need you to do is create a new class by yourself inside the section for a project,

create a new file name built in functions Java, and make sure the built in functions class has the

main method.

So what is a built in function?

A built in function is one that Java already made for you.

Built in functions are general to every application.

For example, every application needs to call the print line function.

Oh, yes.

Every time you go to print line, what you were doing was calling a function named print line and passing

in a string as an argument.

And after you call the function somewhere, somehow you're running an actual function called print line.

That print line function, it receives your string as a parameter, and then somehow print line performs

the magical task of printing your message to the console.

And notice that the print line function is void.

It doesn't need to calculate or return anything.

It only performs the task of printing your message to the console.

How do I know this?

Well, if you hover over the function call, it will tell you that you're calling a void function.

Also, why do we have to write system out before calling the function?

The short answer is the function Print line isn't local to your class, it's in some other class somewhere

else attached to system out.

In any case, inside the built in functions class print.

Hello, Java.

And run your code.

I know it seems silly of me to ask you to print Hello Java, but I hope that you can really appreciate

what's going on behind the scenes.

You're calling the print line function and passing in one argument.

Hello Java.

The print line function existing somewhere it runs and it receives your argument as a parameter.

Then it performs the magical task of printing your message to the console.

Java defines many math functions for you, like log sign or COS.

These functions are part of the math class that Java made for you.

Here's an example of me using the log function to take the natural logarithm of 101.53.

Now, usually these math functions expect a double parameter and return a double value.

Let's say I want to take the log of 119.6.

I would call the log function and pass in 119.6 as an argument.

The log function would run, compute the log and return the value.

Your call now holds the return value which you can store in a variable.

So in Maine, we're going to calculate the sine of 1.2.

And I'm going to store their result in a variable called sign.

Then I'm going to print.

The son of 1.2 is.

The return value that we stored in the variable sign.

I'm going to run my code.

And the sign of 1.2 is indeed 0.93.

But wait, Rianne, how did you know the result would be a double?

Just hover over the call and it tells you the sine function that Java made for you.

It expects a double parameter, and accordingly we pass the A double value.

If you hover back over the call, it also returns a double.

And since the function returns a double, I know to store the return value in a double variable.

Okay.

Now there are math functions that expect more than one parameter.

For example, if I want to calculate two to the power of four, I would need to pass in two arguments

the base and the exponent.

So inside, man, I'm going to calculate two to the power of four.

Double power is equal to math power.

And I'm going to calculate to raise to the power of four.

Then I'm going to print the result.

Two to the power of four is.

The return value from the math power function.

Rerunning this code.

And as I expect to, to the power of four equals 16.

That being said, there are thousands of built in functions when you install the Java development kit.

It comes with thousands of built in functions that you can use.

If you're thinking of memorizing all of them, please stop.

A good developer doesn't memorize code.

A good developer learns to use the internet, read documentation and find resources.

For example, this is how I do things.

Oh, I need to take the square root of a number in Java.

How do I do it?

Is there a built in function that I can call?

Well, I'm assuming it would be a math function, so I would look up math functions.

Java on Google.

The first two links look good, but I always prefer going over to the Oracle documentation.

Then I would do a control f search.

Square root.

And there you go.

It shows me the function that I need, the parameter it expects and the value it returns.

Now I have all the information I need to use this function in my code.

So when you're in doubt about something, go on the Internet and look it up.

I need to emphasize the best Developers know how to use the internet to read documentation and find

resources.

In this lesson, you saw that Java provides thousands of general functions that they think could be

useful to you.

If you're thinking of memorizing all of them, please stop.

A good developer doesn't memorize code.

A good developer learns to use the Internet, read documentation and find resources.

In other words, go on Google and look it up.

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