- Learn Kotlin Programming(Second Edition)
- Stephen Samuel Stefan Bocutiu
- 62字
- 2021-06-24 14:13:27
Import renaming
Import renaming is especially useful when common names are used by multiple libraries, such as java.io.Path and org.apache.hadoop.fs.Path:
import com.packt.myproject.Foo import com.packt.otherproject.Foo as Foo2 fun doubleFoo() { val foo1 = Foo() val foo2 = Foo2() }
If two different packages each use the same name, then we can use the as keyword to alias the name.