Question: how to check if a string variable is empty in java?
Answer: Java String isEmpty() method with example Java String isEmpty() method checks whether a String is empty or not. This method returns true if the given string is empty, else it returns false. In other words you can say that this method returns true if the length of the string is 0.