// if s is null, Java won't bother to test the length of s if ( s == null || s.length() == 0 ) { out.println( "empty string" ); }