ArrayList() vs arrayListOf()

前端 未结 5 1292
无人共我
无人共我 2021-01-20 01:10

I was going through some Kotlin basics and found two syntaxes.

ArrayList()

And

arrayListOf()
         


        
5条回答
  •  南笙
    南笙 (楼主)
    2021-01-20 01:28

    arrayListOf()
    

    is just an extension function that looks like this:

    public inline fun  arrayListOf(): ArrayList = ArrayList()
    

提交回复
热议问题