import
•
코틀린 기본 import
◦
kotlin.*
◦
kotlin.annotation.*
◦
kotlin.collections.*
◦
kotlin.comparisons.*
◦
kotlin.io.*
◦
kotlin.ranges.*
◦
kotlin.sequences.*
◦
kotlin.text.*
•
import 지침
◦
단일 이름을 가져올 수 있다.
import org.example.Message // Message is now accessible without qualification
Kotlin
복사
◦
범위의 모든 엑세스 가능한 콘텐츠(패키지, 클래스, 객체 등)을 가져올 수 있다.
import org.example.* // everything in 'org.example' becomes accessible
Kotlin
복사
◦
이름이 겹치는 경우 as 키워드를 사용하여 해결할 수 있다.
import org.example.Message // Message is accessible
import org.test.Message as TestMessage // TestMessage stands for 'org.test.Message'
Kotlin
복사
•
import 대상
◦
클래스
◦
최상위 함수 또는 프로퍼티
◦
객체에 선언된 함수 그리고 프로퍼티
◦
Enum 상수