Java 11 onward String class in Java has a isBlank() method that returns true if the string is empty or contains only white spaces, false otherwise. As you can see with isBlank() it also checks if String has only spaces. That’s all for the topic Check if a String is Null or Empty in Java.11 Kas 2021