Skip to content

Commit d620002

Browse files
committed
Improved the language of sentences
1 parent 0906eb2 commit d620002

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

lessons/io-conditionals.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -127,10 +127,10 @@ Switch statements are used to execute different code depending on the value of a
127127
}
128128
```
129129
Above is the basic syntax of switch statements. This is how it works:
130-
- The switch expression is evaluated `once`.
131-
- The value of the expression is `compared` with the values of each case.
132-
- If there is a `match`, the associated block of code is executed.
133-
- The `break` and `default` keywords are optional.
130+
- The switch expression is only evaluated `once`.
131+
- The value of the expression is `compared` with the values of each case value.
132+
- If there is a `match`, ie. the case value and the switch expression are same, the associated block of code with the case value is executed.
133+
- The `break` and `default` keywords are optional and will be explained ahead.
134134

135135
Now, let us see a diagramtic workflow of the Java Switch statement for a better understanding.
136136

@@ -187,7 +187,7 @@ Let us see an example to understand it better.
187187
Output : Vowel
188188
```
189189
#### The 'break' Keyword
190-
- When Java reaches a `break` keyword, it breaks out of the switch block.
190+
- When the Java compiler reaches a `break` keyword, it breaks out of the switch block.
191191
- This will stop the execution of more code and case testing inside the block.
192192
- Basically it means that When a match is found, and the job is done, there is no need for more testing. Hence we break out of the switch statement.
193193

0 commit comments

Comments
 (0)