Created
June 14, 2021 02:19
-
-
Save CheolhoJeon/d55e9258b0e7236d5df10e89428e085e to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package chap5.Object | |
import atomictest.eq | |
object JustOne { | |
val n = 2 | |
fun f() = n * 10 | |
fun g() = this.n * 20 // [1] | |
} | |
fun main() { | |
// val x = JustOne() // Error | |
JustOne.n eq 2 | |
JustOne.f() eq 20 | |
JustOne.g() eq 40 | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment