We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 5e1419a commit 410ef3dCopy full SHA for 410ef3d
tp5/src/main/kotlin/fmt/kotlin/fundamentals/Bottle.kt
@@ -1,11 +1,11 @@
1
package fmt.kotlin.fundamentals
2
3
-class Bottle(
+data class Bottle(
4
val name: String,
5
val year: Int
6
) {
7
8
- fun isEqualTo(bottle: Bottle) = false
+ fun isEqualTo(bottle: Bottle) = this == bottle
9
10
- fun isSameInstance(bottle: Bottle) = false
+ fun isSameInstance(bottle: Bottle) = this === bottle
11
}
0 commit comments