Tip: String has the method isEmpty() for performing the comparison length == 0. It's more readable.