java me - How to handle null as a key value in Hashtable in blackberry? -
as, know hash table doesn't allow null. how handle if want put key pair values? there other alternative in blackberry ??
you can extend hashtable this
class nullkeyhashtable extends hashtable { private static object null = new object(); private object nulltonull(object key) { return key == null ? null : key; } public object put(object key, object value) { return super.put(nulltonull(key), value); } public object get(object key) { return super.get(nulltonull(key)); } ... }
Comments
Post a Comment