There's actually a comment out this if else statement here because I want to show you another way in
order to write this line of code here.
These lines of code
so I can just type in C H x true and true yes that said check it.
And here I can actually put in a boolean expression here so I can just put in a pair a pair of round
brackets here and then I can just refer to the name of this true and true valuable true and true.
OK.
Question mark.
True.
Otherwise for us.
OK.
And this means if the value of this true and true valuable is true then X then assigned the value true
to the Smurfette.
This said checked my faith and otherwise if the value of this true and true variable is not true.
So it is false then assign the value false to this strict method.
OK so now let's actually create another line of Cahir see X true and true.
Now that said check it.
And here again I need to put in a pair of round brackets here and now I need to put in an exclamation
mark here.
True and true questionmark true otherwise false.
So here I am specifying that if the value of this true and true value but is not true.
So it is false.
OK if the value of is true and true variable is false then assign the value true to the said checked
Meffert that is related to this see X true and true no object.
And otherwise if the value of this true and true value is actually true.
So as you can see here first we have specified that if the value of this true and true variable is false.
OK.
By putting this exclamation mark we specified that if the value of this true and true value but is false
then assign the value true to this said Chicot method.
Otherwise And that means if the value of these true and true variable is true then assign the value
false to this.
So check the method.
OK.
So if this may sound confusing to you you may want to actually use this if else statements in your code.
And don't worry about our using this way of writing your own code because now you want to actually show
you how you can actually write these expressions.
OK it doesn't really matter whether you try to write IF statements or write your code in this way.
OK.
So hopefully that makes sense.
So as you can see here let's actually run our project and see what happens.
OK.
As you can see here it's now showing us the same results.
OK.
Now as you can see the value of this.
Yes checkbox is actually on.
OK the value of this box is true.
OK.
So this line of code is actually get executed here.
OK.
So hopefully that makes sense.
And let's actually go back inside this content underline line that example and then let's actually dragging
a linearly out horizontal into this linearly Ellsworthy call.
So just click on this linearly or horizontal.
You can actually put it inside this linearly alphabetical order you can actually click on this linearly
output as you call here.
OK.
And then let's actually dragging a a large text view into this linear layout horizontal here.
So just put it inside this linearly and horizontal and then double click and this takes through here.
So for the text just typing here.
True and False.
OK.
And for the ID just typing and for the ID just type in here t x the true and false.
OK.
And here are just press Enter key on your keyboard and then let's actually put tracking two more checkboxes
here inside.
These are linearly out horizontal and by the way we don't need to actually assign an ID to.
These are text views because I don't because we don't want to actually interact with these are text
we use from our Java codes.
But here I just wanted to show you that you can actually assign IDs to your text views in order to interact
with them.
But for this project we don't need to assign an ID to these text use here.
OK.
We just need to assign an ID to these checkboxes here.
So let's actually try again two more checkboxes into this linear layout horizontal.
So just click on the checkbox and then put it inside this linearly out horizontal here and then double
click on this checkbox and for the text just type in here yes.
And for the ID just type in here c h x true and false.
Yes.
And let's actually try again another checkbox into this linearly and horizontal.
So just click on the checkbox here and then put it up beside these are checkbox here and then double
click on this checkbox here.
So for the text just type in here no.
And for the ID just type in here see X true and false no.
And then click on this linearly and horizontal.
And let's actually find the gravity attributes and then check this check box here that says Center underline
horizontal as you can see it's going to actually center the components that are inside of this linearly
out horizontally.
Hopefully that makes sense.
And let's actually go back and say this main activity that you have a file here and then let's actually
create some more objects here.
So here let's actually create a comment here so I can just type in true and false.
Ok so I can just create an object from this text object takes your class and then for the name again
just type in t the true and false and then I need to cast this object to a test object find view by
id r that Id Dot T T true and false.
OK.
And again we don't need to create an object from this test class for this project but of here I just
wanted to show you that you can actually create an object from this class and then relate that this
object to that component.
Inside this screen and interact with it.
OK.
So we need to actually create a checkbox class C X X true and false.
Yes.
Assignment operator and then and then we need to actually cast this object to a checkbox object find
view by id r that Id dot c h x true and false.
Yes.
Again we need to actually create a checkbox class C H x true and false no.
And then I mean to put in an assignment operator here and then we need to actually cast this object
to a checkbox object.
OK fine.
If you by id art that Id dot c c h x true and false.
No.
OK.
So let's actually interact with these objects.
So here let's actually create a comment true and false.
So let's actually create a boolean variable boolean and the name of our variable is true and false.
And then we need to put in an assignment operator here.
So let's actually assign a boolean expression to this variable.
True and false.
And then it's actually putting a semicolon at the end of our statement and then we can actually create
an if statement here.
If true and false and this means if the value of is true and false value but it is true.
So if the value of this expression evaluates to true that true value is going to be assigned to this
true and false value variable and if the value of this true and false value but is true then execute
this line of code here inside of these curly braces C S X true and false.
Yes that said check it.
True it it's going to actually check this checkbox here.
As you can see it's going to take this a yes checkbox.
If the value of this true and false that valuable is true OK and if and else if the value of this true
and false value bet is false.
So exclamation mark.
True and False.
Then execute this line of code here inside of this curly braces.
See it's true and false.
No that said checked.
OK so hopefully that makes sense.
And let's actually run our project and see what happens.