Hire everyone in this theater here I'm going to talk about comparisons OK.
So first we need to create a Java project.
So just click on this find new and then click on Java project.
OK.
So for the project name just type in here.
Comparison's
OK.
And click on finish.
So as you can see here our project is now created.
So we need a class for our project.
So just click on this as our See folder and then click on File new and click on class.
OK.
So for the class name just type in here comparison.
And for the package name we need it.
The worst domain here you just type in here com dot your name.
OK.
And at the end of your package name just put that project name.
OK comparison's
for the modifiers.
Choose public.
And make sure that you take the check box here that says public static void main effort.
OK.
This is going to be our starting point for running our Java code.
OK.
And then click on finish.
So as you can see here our class is now created.
So first let me actually it's this comment here.
So in order to make this a little area of Vider you need to actually double click on this comparison
Dutch over top here.
And as you can see this entire area is now much wider.
OK.
And in order to make this a little area smaller You just need to actually double click and these are
comparisons that Jobar had here.
OK.
So now I want to actually write some code here.
OK.
So as you know I want to talk about comparisons.
Java has several operators for making any comparisons and variables variables and literals or other
types of information in a program.
OK these operators are used in expressions that return boolean values of true or false.
Ok so now let me actually show you some real examples in order to make this concept more clear for you.
OK.
Now I want to create some variables here the data type of my variable is boolean.
The name of my variable is.
For example if you want.
And then I assign a value to my variable.
False.
OK.
So at the end of your statement you need to put in a semi-colon.
OK.
And I want to create another variable here in the name of my value is 8 and I want to assign a value
to my.
For example 25.
So now I want to actually make a comparison here.
So I just need to refer to the name of my boolean variable.
Is.
OK.
And then I just type in here h less than 50 and then at the end of my statement I need to put in a semi-colon
OK.
So first let me actually output the value of these variables to the console system that out that princeling.
And then inside Apprentice's I just need to refer to the name of my variable is young and at the end
of my statement I need to put in a semicolon.
And here again I want to actually output the value of this h variable to the console system that's out
that princeling.
And then inside Apprentice's I need to refer to the name of my valuable which is age.
OK.
And here I want to output the value of this easy and variable to the console.
OK.
So a system that out that print to learn and then inside Apprentice's I just need to refer to the name
of my Yahn qualia.
OK.
And then at the end of my statement you need to put in a semicolon.
So if you are on my project now as you can see it's going to actually output these values to the console
OK.
So the first value is false.
OK.
As you can see I assigned the false value to my boolean variable here.
OK.
And in line 14 I decided to output the value of this variable to the concert which is false OK in line
16.
Are you declared the age variable and I assigned the value 25 to my variable and in line 17 I decided
to output the value of this age variable to the cops.
OK.
As you can see here which is 25.
OK.
As you can see I assigned another value to my is the variable here.
OK.
So the value of this variable here is and comparison expression and this expression produces a result
of either true or false depending on the value of the integer h.
OK because age is 25 OK and age is less than 50.
OK.
And this expression evaluates to true and that true value is assigned to this isn't valuable.
So if I run on my project as you can see this is the value of this is the variable that is out to the
console OK.
So that they actually show you some other examples.
So let me comment out these lines of code here.
So now let me actually create some other variables here.
For example the Data Type of my variable is Boullion and the name of my variable is is powerful.
And then I assign a value to my variable here.
For example fart's.
OK.
And then at the end of my statement I need to put in a semi-colon OK.
So if I output the value of this variable to the console system that out that line and then inside the
prentices refer to the name of my valuable so here I want to put some text here.
This is the value of the is powerful valuable.
OK.
And then at the end of my statement I need to put in a semicolon OK.
So if I run my project now as you can see it's going to actually output this value to the consumer.
So I forgot to actually put the variable name inside it practices so I use that plus operator here in
order to concatenate this text with my variable name.
OK.
Is powerful.
OK.
And here I actually create a space here in order to make this readable.
So if I run my project as you can see it outputs this value to the console.
This is the value of that is powerful variable fots.
OK.
So I assigned the false value to my is powerful value.
OK so now you want to create another variable.
So for example the data type of my variable is it and the name of my variable is energy
OK.
And then I assign a value to my variable.
For example 57 and then at the end of my statement I need to put in a semicolon.
So here I want to output the value of this variable to the console system that out of that peninsula.
And then inside Apprentice's I just need to refer to the name of my variable and at the end of my statement
I need to put an assembly code on OK.
So if I run my project as you can see it's going to output this value to the console.
OK so let me actually put the text here just put into double quotes and inside the double quotes just
type in your text.
For example this is the value of the energy variable
OK.
And create a space here in order to make this value more readable.
OK so if I run my project now as you can see it's now showing an error.
OK.
So as you can see here I forgot to actually put the plus operator in between these two values.
OK.
If you don't put this A-plus OPERATOR You cannot concatenate text and variables together.
OK.
So if you are on my project now as you can see it outputs this value to the console.
OK this is the value of the energy value of it.
OK.
Which is 57.
OK.
So now I want to actually make a comparison here.
So I need to refer to the name of the boolean value.
Here is powerful.
OK.
And then I assign a value to my variable.
And so I want to actually create an expression here.
So energy greater than 80.
OK.
And then at the end of my statement I need to put in a semicolon.
So as you can see here it's now showing me an error here.
Let's actually how there are mouse pointer over the error area.
So let's actually hover our mouse pointer over the error area and see what's this error.
So as you can see I didn't write my variable name correctly.
OK.
And I need to actually put the letter E here.
So now the error is gone.
OK so now I want to output the value of.
This is powerful variable to the console.
So I just need to type in here system that out that printed on and then inside the prentices I just
need to refer to the name of my variable is powerful.
And then at the end of my statement I need to put in a semi-colon.
OK.