Wang Liping -- Differences Between ContentValues, HashTable, and HashMap, hashmaphashtable
ContentValues: A storage mechanism, key-value
Feature: key can only be of the string type, and value can only be of the basic type, not an object.
Application: insert data into the database in Common Terms
ContentValues values = new ContentValues ();
Values. put ("name", "xh ");
Values. put ("level", 5 );
SQLiteDataBase db = helper. getWritableDatabase ();....... Partial Code omitted
Db. insert ("hero_info", "id", values );
Certificate ------------------------------------------------------------------------------------------------------------------------------------------
HashMap: it is a lightweight Implementation of Hashtable (non-thread-safe implementation). They have completed the Map interface,
Features: NULL key values are allowed. Because of non-thread security, the efficiency may be higher than that of Hashtable. HashMap allows null as the key or value of an entry, whereas Hashtable does not.
Certificate ---------------------------------------------------------------------------------------------------------------------------------------------
HashTable: thread-safe Collection
Feature: null cannot be used as the key or value of an entry.
----------------------------
The hash/rehash algorithms used by Hashtable and HashMap are roughly the same, so there is no big difference in performance.