All language subtitles for 007 Running your First Code (Windows)_en

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

This video is for Windows.

If you're using a mac computer, please go to the previous lesson.

So far.

You installed Visual Studio Code, a text editor where you can write code and you installed Java inside

your computer.

So now you can run Java code.

In this lesson.

That's exactly what you're going to do.

You will write and run your first Java code.

Step one is to create a folder.

Simple enough inside of your desktop.

Make a new folder.

And call the folder section.

One.

This folder is going to contain your Java file.

Step two is to launch the folder from Visual Studio Code.

Here I have Visual Studio code.

Open.

Go to file open folder.

Find the section one folder that you just created.

Mine is inside of desktop and here select the folder section one.

Once you select it, press select folder in order to launch it.

Step three is to create a Java file.

When creating your Java file, you must name it using the camel case format where the first letter of

every word is capitalized and the words themselves are joined together.

And your file.

For it to be considered a Java file, it needs to end with the extension Java.

Let's do just that.

I'm going to create a new file by pressing the plus icon, and the file is going to be called Hello

Java again using Camel case, where the first letter of every word is capitalized, followed by the

DOT Java extension.

And here we've created a hello Java file.

Beautiful.

Step four is to create a Java class inside the Java file.

In Java.

You will write all of your code in a class.

And there are two parts to a class the class keyword.

Followed by the class name.

Inside brackets is where you would write your code.

And furthermore, the class name needs to always match the file name that it's in.

So if the file name is called Hello, Java and Java, the corresponding class is Hello, Java.

Inside your Java file, you can create your Java class.

So start with the class keyword.

Followed by the class name itself.

Hello, Java.

And inside brackets is where you're going to write all of your code.

Perfect.

We made a lot of progress.

Let us delete all of our progress.

We're going to delete our Java file.

But wait a second.

Ran.

We made all of this progress, and now we're just going to delete it.

Just trust me.

So go here, delete your file.

Because we already created a Java file.

Now these code knows that this workspace is meant for Java development.

So the second time we create a Java file, remember to use camel case.

Now VS code is ready and it's going to auto generate the class for you by default.

It adds a public keyword which makes our Hello Java class publicly accessible to other classes that

may exist inside of this workspace.

But there are no other classes in this workspace, so public is not really doing anything.

You can keep it, you can remove it.

It doesn't really matter.

It's up to you.

I'm just going to keep it.

Step five Your class needs a main method.

Maine is the entry point of a Java application.

This is where Java starts running your code when you run your application.

Java starts by looking for the main method so inside of your class.

Press enter after the first bracket to get proper indentation and then right main.

Choose the first option.

And by clicking this option, the code automatically writes the main method for you.

Now, this might look like a lot of code and it might look a bit scary, but rest assured, the main

method always looks like this.

All you need to know is that this is the entry point.

This is where Java starts running your code.

Inside of Main, we're going to print a message and you can do this using the print line function.

So system.

Dot out dot print line.

Instead of double quotes, I'm going to write.

Hello, Java.

Before we do anything else, let's break this line of code down.

Print line is a function that prints a message to the console.

In parentheses is where you place the message that you want to print.

And the semi-colon is very important.

The semicolon means end of statement.

Every statement in Java, every line of code needs a semicolon at the end.

If you forget your semicolon.

Java is going to throw a big red error.

If you hover on the error, it tells you that you forgot a semicolon, so you need to insert it.

On the topic of errors.

If you misspell the function, you're going to get an error.

Java has no idea what function this is.

It has no idea what you're talking about.

And last but not least, code in any programming language is sensitive.

If you capitalize a letter that shouldn't be capitalized, you're also going to get an error.

Java does not recognize the print capital T function, so please be careful.

Your syntax needs to always be exact.

It needs to always be perfect.

And you'll remember that the class name needs to always match the file name.

So if I were to misspell the class by capitalizing a random letter that I shouldn't here, Java tells

us that this class name does not match the file name that it's in, so we need to fix it.

So please make sure that your syntax is always exact.

Step six is to turn on autosave.

The white dot means that you have unsaved changes.

So what you would do is go to file.

And then press save.

Now your file is saved.

And if I were to change the string, for example, if I were to add a bunch of exclamation marks.

The white dot reappears.

And now I have to save my code again.

Now, this can be a bit annoying, so just turn on autosave.

And now every time I make changes, the application saves by itself.

The final step is to run your application.

So once you're certain that your code is good, there are no syntax errors, there are no red underlines.

You can execute it the run button.

Execute your code.

And there you go.

It prints out our message.

When you execute your code, Java looks for the entry point, it looks for main tries to find it, and

once it does, it's going to run the code inside.

The first line of code inside main prints.

Hello Java.

Then it looks for more code inside main, but there isn't any, so it reaches the end.

If you have any syntax errors, your code is not going to run.

Here.

It's telling me that I have an error inside of line number four and I need to fix it.

If I rerun my code now.

It works beautifully.

And now I can keep running my code to my heart's content.

All right.

With that being said, congratulations.

You wrote and ran your first Java code.

In this lesson, you learn that all of your code must exist in a Java class.

You created a class called Hello.

Java Main is the entry point.

This is where Java starts running your code.

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