Checking if a String is empty

Since Java 6 there is a new way to check if a String is empty. The most common way to determine if a String is empty is to call the length() method of the String class and check if it returns 0.
There is now a method added to the class called isEmpty() which returns a boolean value.

The output from the code below is:

Search for more Java info on this site here:
Custom Search

Please type any questions here.