How to check whether a Hashtable is null in Java -
How to check whether a Hashtable is null in Java -
given next java codes:
hashtable<string,integer> hs = new hashtable<string,integer>(); if(hs==null){ system.out.println("this table blank"); } a new hashtable created no pairs. why there no output console? way, how check whether hashtable null?
the hashtable isn't null when it's empty; object still there. utilize isempty() method instead.
if (hs.isempty()){ java hashtable
Comments
Post a Comment