Validating Null and Empty Strings. The Java programming language distinguishes between null and empty strings. Checking for Null or Empty or White Space Only String in. methods to Java's String class to support this check. Checking for Null or Empty or. Iterating an empty list is totally accepted and will just do nothing, whereas iterating a null list will throw a NPE. Avoiding Null Checks In Java […] //initialize someString String someString = new String( ); //some code here with that may reset the string someString //now I need to check if someString is empty. Example shows how check if a string or charSequence is not empty and not null. check if a String is null or empty using java. Check if string is null or empty. programming forums Java Java JSRs Mobile Certification Databases. how to check the list is empty. please suggest me that how can I check that list is empty. Prefer empty items to null ones. never have to check for null values. // PRIVATE /** The underlying collection. */ private List fStocks; /** A constant, empty. Java ArrayList - Check if list is empty. it always says 'List isn't empty'. import java.util.*;. JOptionPane.showMessageDialog(null, List isn't empty );. Does java.util.List.isEmpty() check if the list. * * @param coll the collection to check, may be null * @return true if empty or null * @since Commons. You're right about the array and I did forget about the null check. I wanted to add the null/empty string test even though the OP asked about the array because the.