When to use Sparse...
When to use Sparse...
Here is a concise answer to the Android interview question "When to use SparseArray vs HashMap?":
Use SparseArray when:
SparseArray is more memory efficient than HashMap for storing integer keys because it avoids the overhead of Integer wrapper objects. It's a good choice when you have a limited set of integer keys.
Use HashMap when:
senior
Gợi ý câu hỏi phỏng vấn
Chưa có bình luận nào