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

Popular posts from this blog

Delphi change the assembly code of a running process -

json - Hibernate and Jackson (java.lang.IllegalStateException: Cannot call sendError() after the response has been committed) -

C++ 11 "class" keyword -