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

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.

主站蜘蛛池模板: 汤阴县| 依安县| 林甸县| 雷州市| 高唐县| 武夷山市| 松阳县| 左权县| 宜兴市| 黑山县| 沧州市| 西宁市| 简阳市| 邻水| 万年县| 蓝田县| 佛山市| 洪泽县| 济南市| 郯城县| 久治县| 乳山市| 古交市| 娄底市| 昌乐县| 类乌齐县| 浙江省| 瑞金市| 全州县| 奇台县| 江永县| 姜堰市| 密山市| 仙居县| 郯城县| 东辽县| 福清市| 土默特左旗| 赤城县| 平陆县| 海淀区|