contentvalues & bundle &hashtable 之间的区别
来源:互联网 发布:五线谱作曲软件 编辑:程序博客网 时间:2024/06/11 11:07
平时的开发中我们经常会遇见contentvalues,bundle,hashtable,hashmap这些类,总是感觉他们用法很像但是又不清楚他们之间有什么区别,今天抽空看了一下,总结出来供大家参考。
一,contentvalues
contentvalues的实现就是通过hashmap实现的,我们查看contentvalues的构造函数就能发现mValues = new HashMap<String, Object>(8);这说明contentvalues就是对hashmap的包装类,只是他把key固定为string类型,也就是说contentvalues的存储的键值对,键必须是string类型,而值是一些简单的内部类,int bool 等。android 文件存储的时候就是以contentvalues的形式写进去的。
二,hashtable
hashtable已经逐渐被hashmap代替,不鼓励使用。
三,bundle
bundle其实也是一个key-value 的键值对,也是通过map实现的。他是一个string到其他可打包数据类型的map。一般activity间的数据传递,比如oncreate中传入的参数就是一个bundle。
四,hashmap
hashmap是map的一种实现,支持各种操作,所有类型的要素都可以作为键或者值,包括null.
0 0
- contentvalues & bundle &hashtable 之间的区别
- ContentValues和HashTable和HashMap的区别
- 王立平-- ContentValues , HashTable , HashMap区别
- ContentValues 、HashMap和HashTable
- ContentValues、HashTable、HashMap异同
- ContentValues和HashTable分别
- 安卓开发-ContentValues类+Bundle类的作用
- HashTable、HashMap、Vector、ArrayList之间的区别
- Hashtable 和 HashMap之间的区别
- HashMap与HashTable之间的区别
- Hashtable 和 HashMap之间的区别
- HashMap,HashTable,HashSet之间的区别
- Hashtable 和 HashMap之间的区别
- HashTable,HashMap,LinkedHashMap,TreeMap之间的区别。
- ContentValues和HashTable和HashMap
- ContentValues和HashTable和HashMap
- ContentValues和HashTable和HashMap
- ContentValues和HashTable、HashMap简介
- ADB not responding. You can wait more,or kill"abd.exe" process manually and click 'Restar
- java.lang.UnsupportedClassVersionError
- Android volley和webview同步cookies
- Deploying Jekyll project to GitHub Pages
- 测试框架初体验
- contentvalues & bundle &hashtable 之间的区别
- 5.4.4 Path Sum II
- 面试:如何测试一个杯子
- no android facet found
- Qt图形框架资料04
- HHUC-2015-dfs专讲①,A:ring road
- Redis安装【centos7】
- iOS 使用百度地图地图画成功了,但是没有图层显示问题解决。
- Sitemesh