官术网_书友最值得收藏!

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.

主站蜘蛛池模板: 中卫市| 曲周县| 修武县| 靖安县| 普安县| 安溪县| 台山市| 保山市| 宣城市| 合山市| 莎车县| 长沙县| 皮山县| 依兰县| 会昌县| 广河县| 化隆| 临城县| 图片| 五原县| 高邮市| 莲花县| 灌阳县| 筠连县| 随州市| 内黄县| 上饶市| 开鲁县| 堆龙德庆县| 略阳县| 夹江县| 婺源县| 榆树市| 宁陕县| 含山县| 恭城| 罗田县| 策勒县| 嘉兴市| 大港区| 花莲县|