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

Popular posts from this blog

monitor web browser programmatically in Android? -

Shrink a YouTube video to responsive width -

wpf - PdfWriter.GetInstance throws System.NullReferenceException -