string not null or empty java code example Example: check if string is null or empty java Click to copyif(str != null && !str.isEmpty()) { /* do your stuffs here */ }