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
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