Skip to content

Commit ec88c38

Browse files
chore(examples): update Introduction examples
1 parent 55537f9 commit ec88c38

File tree

7 files changed

+25
-231
lines changed

7 files changed

+25
-231
lines changed

examples/01_introduction/00_description.md

100644100755
File mode changed.

examples/01_introduction/01_Hello world.md

100644100755
File mode changed.
File renamed without changes.

examples/01_introduction/02_String Templates.md

Lines changed: 0 additions & 20 deletions
This file was deleted.
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
# Equality Checks
2+
3+
Kotlin uses `==` for structural comparison and `===` for referential comparison.
4+
5+
More precisely, `a == b` compiles down to `a == null ? b == null : a.equals(b)`.
6+
7+
<div class="language-kotlin" theme="idea">
8+
9+
```kotlin
10+
fun main() {
11+
//sampleStart
12+
13+
val authors = setOf("Shakespeare", "Hemingway", "Twain")
14+
val writers = setOf("Twain", "Shakespeare", "Hemingway")
15+
16+
println(authors == writers) // 1
17+
println(authors === writers) // 2
18+
//sampleEnd
19+
}
20+
```
21+
22+
</div>
23+
24+
1. Returns `true` because it calls `authors.equals(writers)` and sets ignore element order.
25+
2. Returns `false` because `authors` and `writers` are distinct references.

examples/01_introduction/03_Variables.md

Lines changed: 0 additions & 68 deletions
This file was deleted.

examples/01_introduction/04_Functions.md

Lines changed: 0 additions & 143 deletions
This file was deleted.

0 commit comments

Comments
 (0)