Java isEmpty or "".equals for performance -


this question has answer here:

i'm writing lot of components in adobe cq have deal lot user set properties. , i'm getting little tired of null checks before can isempty check.

i'd like.

"".equals(string); 

this lot more readable, how compare performance wise. , yes expect create "" constant if there multiple checks.

thanks d

use objects.equals() . solves problem perfectly.

http://docs.oracle.com/javase/7/docs/api/java/util/objects.html#equals(java.lang.object,%20java.lang.object)


Comments