Difference between SparseArray Vs ArrayList?

后端 未结 2 1014
情歌与酒
情歌与酒 2021-02-01 16:02

I want to know performance and efficiency of SparseArray and ArrayList and which one is better to use. I can\'t understand when to use SparseArra

2条回答
  •  余生分开走
    2021-02-01 16:18

    SparseList implements a SparseArray. This class is identical to java.util.ArrayList, except that the former permits assignment to array indexes that are beyond the current length of the list, using the expected set() and add() methods.*

    I think here there is all you need to know to understand which one to use.

    SparseList is also more efficient

    more info here

提交回复
热议问题