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

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.

主站蜘蛛池模板: 宁海县| 大渡口区| 宿迁市| 长白| 乌什县| 易门县| 江口县| 五莲县| 天门市| 栾城县| 平阴县| 上蔡县| 乌恰县| 化州市| 大荔县| 那坡县| 金华市| 綦江县| 北京市| 衡南县| 安陆市| 汤原县| 六安市| 天祝| 滨海县| 富平县| 高州市| 称多县| 方山县| 安丘市| 屏边| 开封县| 轮台县| 晋江市| 北流市| 都江堰市| 若羌县| 抚顺县| 泰和县| 宜黄县| 吉安市|