Hire everyone in the theater you will I'm going to talk about comments variabilis and primitive data
types.
So first I you to create our Java project.
So first we need to click can find new and click on Java project for the project name.
Just type in variables and I choose the default location for saving my project here and click on finish.
And as you can see here my project is created.
OK.
Now we need to create a Java class for our project.
So first click on this as RC for that.
Or you can click on this variable's project and then click on find Neil and click on class.
OK.
Now we need to actually enter our last name here.
So for the class and just type in variable and make sure that your class name starts with a capital
letter.
Because this is a convention in Java that all your classes should start with a capital letter.
OK so this is really important.
And here for the first time I really don't actually enter a package name for our package.
And as I said earlier in this section that package is just a way to actually organize our Java files.
OK.
So for the package name we just need to actually type in a reverse domain so calm that Mortaza.
OK that's an idea and we just need to actually enter our project name variables.
OK.
And this is a convention in Java that you should actually name your package names.
OK.
Like this.
OK.
A reverse domain.
And at the end just enter your project name and for the modifiers just check it is a public modifier.
And here check this checkbox here that says public is static void main method.
This is a starting point for actually running our Java codes and click on finish.
And here as you can see our class is created and here is our package name.
OK this is our package name as you can see here and in our project directory.
When you open the source folder inside the source folder there is a package and this is the package
name as you can see here.
And here is the same package.
OK.
So the package name of the class is established by the package statement.
Ok this is our package statement.
OK.
Which must be the first line of a Java program when it is used.
OK so that's it for packages.
OK.
Now I'm going to ask you about comments.
So as you can see here are this line of text here is a comment.
OK.
I can create my own comments to for example and putting our two forward slashes and then I can actually
type.
I just enter what ever it takes that I want.
Ok what ever text that I want.
OK so what are comments.
First let me point out that comments are one of the most effective ways to improve our programs readability.
OK.
These are text included in a program that explains what's going on in the code.
OK.
And the Java compiler is going to actually completely ignore these lines of text.
Ok these comments.
So what is a compiler.
As I said in the previous section or compiler is a special software compiler is exclusive software that
actually convert your Java code into a language that the machine can understand.
OK so now I'm going to show you some real examples about using comments in your programs.
So first of all I want to show you how to actually make this editor area wider in order to write our
codes better.
OK.
So in order to make the is actually the editor area wider you just need to double click on this variable
to job hop here which as you can see this little area is much wider now.
And in order to go back to the default screen just DoubleClick is valuable over here.
And as you can see here this is the default screen.
OK.
So now I want to actually out with Dave or hello to the council.
So let's see what happens system that out princeling and inside the Apprentice it's just I just put
in a two level codes and just type in Hello
cake and at the end just up with a semi-colon at the end of your statement here I want to actually use
a comment that explains what this code here is doing.
So let's see what comments are.
As you can see I am the one to actually I am out putting forth
hello to the console.
So here as you can see this comment here is just explaining what this code what this statement here
is doing.
OK.
And the compiler completely ignores these comments.
OK.
So first let me actually run this program and let's see what happens.
So as you can see the vault Halo is out with the console area and these comments are completely ignored
by the compiler.
OK.
So it's really good to actually get into the habit of writing comments in your programs.
It's going to make your programs more meaningful for yourself or other programs that may actually look
at your codes in the future.
OK.
So always use comments in your programs.
And we have three kinds of comments in Java.
So first of all we have got our single line comment.
So as you can see here these comments are called single line comments.
OK.
So in order to create a single line comment just putting two forward slashes and typing your text.
For example this is called This is called a single line comment.
And everything from the slushes forward as you can see here is called the comment and it's going to
be completely ignored by the compiler.
OK.
Another type of comment is a multi-line comment.
So for example if you want to create a multi-line comment in my program I just need to start my multi-line
comment with a forward slash and multiply operator and that I need to actually end my multi-line comment
with the multiply operator and a forward slash.
So this is very important.
You need to actually start your model and comment with a forward slash and then multiply operator or
the star symbol as you can see here.
And then we need to end our multi-line comment.
Multiply operator and forward slash So everything between these two delimiters is considered a comment.
So for example if I just press on the Enter key on my keyboard as you can see here I can actually put
in my text here so I can just type in here.
This is called Amante line comment as you can see here.
OK.
So this text this line of this line of text here is completely ignored by the compiler or the compiler
is going to ignore everything that we hide between these two delimiters.
OK.
The last type of comments is called Javadoc comments.
OK.
For example if I want to create a job with comments in my program first I just need to begin my Java
comment with a forward slash and to multiply operators and then I need to end my job what I comment
with the multiply operator and our forward slash.
So as you can see here everything between these two delimiters is considered a Java like comment.
OK so for example if I again present Enter key on my keyboard as you can see here I can type in here
anything that I want.
For example I can type in here.
This is called Java that comment Java dodge comment.
OK.
But we don't use actually Obstat comments in our programs and Jodo comments are designed to be read
by utilities such as job attach a command line tool.
That's part of Java Development Kit JDK.
OK.
This tool uses official comments to create a set of web pages that document that the functionality of
of a Java class.
OK.
So we don't actually use this.
This Java comment a lot in our programs.
OK.
But later I want to show you more about comments in our programs for example.
If I don't want to actually execute this line of code here for example if I run my program now you can
see that it's going to show me the hello text here but if I don't want to actually execute this line
of code I can easily comment out this line of code.
OK.
Now you can see that if I run my program it's going to show me nothing because this this statement is
now commented out.
OK.