Skip to content

Commit 5f74dd3

Browse files
D3nn7SebastianAigner
authored andcommitted
Update 01_When.md
use number instead on name for "1".
1 parent 24abc7c commit 5f74dd3

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

examples/02_control_flow/01_When.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ class MyClass
2727
```
2828

2929
1. This is a `when` statement.
30-
2. Checks whether `obj` equals to one.
30+
2. Checks whether `obj` equals to "1".
3131
3. Checks whether `obj` equals to `Hello`.
3232
4. Performs type checking.
3333
5. Performs inverse type checking.
@@ -60,7 +60,7 @@ class MyClass
6060

6161

6262
1. This is a `when` expression.
63-
2. Sets the value to `"one"` if `obj` equals to one.
63+
2. Sets the value to `"one"` if `obj` equals to "1".
6464
3. Sets the value to one if `obj` equals to `Hello`.
6565
4. Sets the value to `false` if `obj` is an instance of `Long`.
6666
5. Sets the value "42" if none of the previous conditions are satisfied. Unlike in `when` _statement_, the default branch is usually required in `when` _expression_, except the case when the compiler can check that other branches cover all possible cases.

0 commit comments

Comments
 (0)