Created
June 17, 2021 07:42
-
-
Save CheolhoJeon/c05fd6b275a80736e4c924fccb6f4988 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.CompanionObjects | |
import atomictest.trace | |
class CompanionInit { | |
companion object { | |
init { | |
trace("Companion Constructor") | |
} | |
} | |
} | |
fun main() { | |
trace("Before") | |
CompanionInit() | |
trace("After 1") | |
CompanionInit() | |
trace("After 2") | |
CompanionInit() | |
trace("After 3") | |
trace eq """ | |
Before | |
Companion Constructor | |
After 1 | |
After 2 | |
After 3 | |
""" | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment