And this means that of actually switching between the values of these names Thring valuable and many.
And in case the value of these names to be invaluable is animal one.
OK.
So in this case the value of this name string variable is animal space mean the money.
But here I am specifying that in case the value of this name string variable is animal one here I am
just typing this through each.
That said Taste of animal name is animal one and break.
So let's actually run our project and see what happens.
So as you can see here our application is is running on this emulator here.
So if we actually click on this start the search button here let's see what happens.
You can see nothing is happening here.
So why.
Because here I actually specified that the value of this name string variable is animal one.
And in this suchit statement I am spit.
I am actually switching between the values of this name string variable.
OK.
And here I am telling the computer that in case the value of this name string valuable is animal 1 please
execute this line of code here.
OK.
And then break out of this switch statement.
So now let's actually change the value of this name string variable to animal one and let's actually
run our project again and see what happens.
OK.
Now our application is running on this emulator.
So let's actually click on this.
Starts the switch button here.
As you can see it says our animal name is animal one so it is now executing this line of code here.
Why.
Because this value is the same as the value of this name string variable.
OK.
So let me actually explain to you once again that in line 63 I created a value but of types 3 and called
names 3.
And I assign a value to a variable.
And in line 65 I actually created a switch statement and inside Apprentice's of this switch statement
I am actually specifying that we are going to switch between the values of these names string variable.
OK so each name string.
So now we're actually inside of the switch statement and here I am actually saying that in case the
value of these names thing valuable is animal Vonne Please execute this line of code here takes the
switch that said text or animal name is animal.
So let's actually create another case.
So case and then again just putting a value of types strange.
So for example the name of our animal is lion.
OK.
And then I need you I need to put in a call on here and now I can just take anti-X the switch that said
text and then say that prentices again just put into double codes.
And now again just typing the name
of any man is lawyer OK.
And now I own it.
And then I need to actually put in the break statement here in order to break out of these are a switch
statement.
So let's actually run our project and see what happens.
OK.
Now our application is actually running on the simulator here.
So let's actually click on this.
Start the search button here and see what happens.
Our animal name is animal one.
OK.
So because the value of this name string valuable is animal one is going to actually go inside of this
switch statement because inside of this prentices I specify that I want to switch between the values
of these name string variable.
So it is now going to actually go inside of this switch statement and then it can actually execute these
lines of code here.
So here I am actually saying the computer that in case the value of this name string variable is animal
one executes this line of code here.
And in case the value of this name string variable is line execute this line of code.
So because the value of these names thing valuable is animal one it is now executing this line of code
the key or animal name is animal one.
OK.
So let's actually change the value of this name string valuable to Lion and let's see what happens.
OK.
Our application is ready.
So let's actually click on this.
Start the switch button here.
As you can see it says the name of our animal is lion.
OK so now it is actually executing this line of code.
The name of our animal is lion.
OK.
So hopefully that makes sense.
And now let's actually now we want to actually specify that if you don't put this break statement here
it is going to actually execute the other lines of code after this case here.
OK so if I actually delete this break statement here it is now going to actually consider that in case
the value of our names thrain is animal one execute this line of code.
OK.
And it is not going to actually break out of this switch statement.
And that again is going to actually execute this case statement here is going out and executed these
lines of code here too.
So now and then it's going to actually look inside the value of this names names string variable.
And if the value of that name string variable is Lion it is actually going to execute this line of code
here and then it is going to actually break out of this switch statement.
OK we have another case default and here we are actually it is the same as the else part of our if else
statements.
And this does mean that if the value of these names thing valuable is not of animal van and it is also
not lion and that he I can't just put in another value to the switch that said text.
And inside the apprentice's I can just put into double quotes and I can just type in the name of our
animal is something else.
OK so now let's actually on our project and see what happens.
OK.
Now as you can see here our application is running on this emulator.
So if we actually click on this starts to switch in here as you can see it says the name of our animal
is Lion.
Why.
Because as you can see the value of this name string variable is lion.
And let's actually change this value to something else.
For example a l.
And let's actually do our project and see what happens.
OK so now let's actually click on this.
Start the switch button here and it says the name of our animal is something else.
OK.
So it is going to actually execute the switch statement here.
And then it can actually see that whether the value of these names thing variable is animal Vonne it
is going to execute this line of code.
And if the value of our names in variable is lying it is going to execute the design of code and then
break out of the switch statement and that it is going to execute the other lines of code below this
switch statement.
OK.
And the it is different means that if the value of these are names thing valuable is not anymore one
or it is not a line it is going to actually execute this line of code.
OK.
This is like the the last part of of the IF statements that we saw in previous tutorials.
OK.
So hopefully that makes sense.
Ok everyone.
Now I want to talk about the break statement and the continue statement.
So first of all let me actually comment out these lines of quote here because I don't want to actually
execute these lines of code here.
OK.
And let's actually go inside these between loops that sit and listen and Meffert.
And now let's actually create another full loop here.
OK.
So I just need to type in here for.
And then inside Apprentice's first I need to actually specify the initial value.
So int for example x assignment operator zero.
OK.
Until X is less than for example number 30 semicolon.
And here I can just type in X plus plus.
OK.
And then I need to actually open and close my full loop by using these curly braces.
OK.
So now I want to actually talk about the larger class.
OK so now I just need to defend to the name of the class lug.
That's right.
OK.
So first of all I just need to put it into double quotes here and inside of double quotes just typing
l o g.
OK.
Comma.
So remember that characters of this lot.
What here is is uppercase.
OK.
And then I can just typing x.
OK.
And then I can just refer to the name of this variable here because I want to actually output the value
of these x variable to their lock.
OK so I just need to put in a semi-colon here.
And as you can see here is nationally as an error.