What is the Clear Purpose of SparseBooleanArray?? [ I referred official android site for this ]

前端 未结 4 1986
误落风尘
误落风尘 2021-01-08 00:40

I referred the android doc site for \"SparseBooleanArray\" class but still not getting idea of that class about what is the purpose of that class?? For what purpose we need

4条回答
  •  旧巷少年郎
    2021-01-08 01:12

    Like the javadoc says, SparseBooleanArrays map integers to booleans which basically means that it's like a map with Integer as a key and a boolean as value (Map).

    However it's more efficient to use in this particular case It is intended to be more efficient than using a HashMap to map Integers to Booleans

    Hope this clears out any issues you had with the description.

提交回复
热议问题