So I cannot actually create another statement here or system that out that print slant as you can see
here inside Apprentice's just put into double quotes and typing here Heidi for example.
OK.
And then I need to put in a semicolon at the end.
And again if I run my program you can see that that is going to show me the high wire in the console
area.
OK.
But if I comment out this line of code here with multi-line comments as you can see here and now if
I run my project it's going to show us nothing.
OK.
Why why it's not showing us anything because I have commented out this statement here and this is statement
here.
OK.
I have commented out this statement here with a single line comment.
As you can see here and I have commented out this statement here with a multi-line comment.
OK.
So for example if I erase these delimiters here as you can see here and if I run my projects now it's
going to show me the high text here.
OK.
Or if I delete these two slashes here and if I run my project again it's going to show me the hello
text and the text.
OK.
So that's it for comments.
And next I'm going to talk about variables.
Variables are just placeholders for data in our program.
OK.
For example if I to create a variable in my program or first I need to specify the data type of my variable.
For example the data type would be integer.
OK.
As you can see the data type of my variable.
Is it integer.
OK my variable is going to hold an integer number or a whole number.
OK.
And then I need to specify the name of my variable.
For example numbers.
OK.
And that's enough for actually creating a variable.
And at the end I just need to put in a semi-colon.
And as you can see here my variable is now created.
OK.
And optionally I can assign a value to my variable here.
For example number 20.
OK.
So as you can see here I assigned the value 20 as you can see here on the right hand side of the OPERATOR
OK to the left hand side of the operator.
OK so this is not an equal operator.
This is just an assignment operator so you must actually consider that this is an assignment operator
not an equal operator because we are assigning this value on the right hand side of the operator to
the value on the left hand side of the OPERATOR OK so this is very important.
Later I'll explain more about this assignment operator.
But for now just know that this is an assignment operator assigning a value to our variable is called
initialization of that value.
So as you can see here we assigned a value to our variable.
So we just initialize our variable.
So for example if we want to declare another variable ok for example and another number into another
number here I just declare my variable not initializing it.
So as you can see here I didn't assign a value to my order number variable here.
I just declared my variable OK.
I didn't actually initialize my variable.
I just declared it.
OK.
This is called the declaration of evaluation.
Then you actually declare a variable and not initialising get.
This is called declaration of a variable.
OK.
But in the case of number variable valuable as you can see here I declared and assign a value to my
valuable.
Or in other words I declared and initialized my body.
OK.
So this is called declarant and initializing a value.
OK.
So now I'm going to show you how you can actually output the value of your valuables to the console.
OK.
Now I want to output the value of this number variable to the console which is 20.
OK.
So let's see how we can do that.
First we need to actually type in system that out that princeling.
OK.
And then inside Apprentice's we need to put into double codes and then inside the double quotes we need
to actually put in our For example some text.
And then we need to put the semi-colon at the end our statements.
OK so now let's just run our project and see what happens.
So as you can see here it's going to output this text in between these double codes.
Ok to the console area.
OK.
You can access the concert area here.
OK.
So what I don't want just this text I want to actually output the value of this number of variables.
OK.
The de-value is 20.
So how can I access the value of a variable.
So now let me show you.
So not just delete this subtext here.
And in order to access the value of the variable we just need to refer to the name of that variable.
OK.
So this is the data type of value.
OK.
And this is the name of our variable and this is the value that we assigned to our variable.
OK.
So in order to access this value OK this value that you can see here we just need to refer to the name
of that variable.
Which is this.
OK.
So now I just need to type in here number and now I am referring to the name of this variable.
So now if I click on this run button as you can see it's gonna output the value to 20 to the concert
area.
OK.
So that's it.
That's how you can actually access the value of a variable.
OK.
You just need to actually refer to the name of that variable.
And as I said before if you don't have the console window open in your eclipse you just need to click
on this window OK and show you and then click on cancel.
OK.
And now it's going to open the console window for me.
OK.
So another concept that I want to teach you here is that how you can actually use variables and texts
together OK.
For example if you want to go out with some text here it's going to show me an error.
Ok so what's this error syntax error and talk and this text.
Dystocia.
So what should I do in order to output the value of this variable and the text between these two double
quotes to the council area together.
OK.
So if I run my project now it's not showing me a pop up that says errors exist in required projects.
Ok variables proceed with lunch.
No I can't because there is error.
Ok so you can't run your project as you can see here is it's the sign of error.
Ok syntax error on talken the text it is torture.
So what's the solution for this problem.
OK.
So in order to actually concatenate or Linge are valuable and it takes to get there in your programs
you can just actually put a plus operator in between those actually values.
For example as you can see here this is my number variable.
OK.
And I am using a plus operator here.
And then we can actually use our text.
So as you can see the error is gone and now I have I can run my project.
So this is our values.
This is the number 20 is the value of our variable.
So and this text is the text between these two double quotes.
So for example if I just put a space here and run my project now as you can see these two values are
separated now.
So for example if I want to actually concatenate or Linge to text together in my program I can just
delete this number of variable and just put the double quotes and between these two double codes I can
put my values for example values.
OK.
Everything that I want and then just run my project.
And as you can see it's going to show me these values and the space as you can see this is the space
here that I've put.
OK.
And the text between these two double quotes.
OK.
So that's it for concatenation in Java.
So now let me show you another example of concatenation in Java.
So in order to actually output some results to the console I just need to type in here again system
that out that princeling and then inside the parentheses just put the double quotes instead of double
quotes just type in your text.
This is my text.
OK.
This is my example variable.