Difference between get() and subscript([ ]) operator in kotlin

Viewed 19

Both get() and subscript operator do the same work, so which one to use or is there any major difference.

val arrayList = ArrayList<Int>()
arrayList.add(10)
println(arrayList.get(0)) //10
println(arrayList[0]) //10
0 Answers
Related