What is the best way to check default value of collections (List ,Set and Map) in java ?
Example :
- List l = new ArrayList();
- Map m = new HashMap();
- Set s = new HashSet();
Condition check:
Wchich case it's better either isEmpty() or null ?
if (l.isEmpty() || l==null){ }
Aucun commentaire:
Enregistrer un commentaire