I suppose you could do it that way. It seems a lot easier to detect one digit than it is to compare the number of letters to the length. But go with whatever fits into your head the best.
Type: Posts; User: KevinWorkman
I suppose you could do it that way. It seems a lot easier to detect one digit than it is to compare the number of letters to the length. But go with whatever fits into your head the best.
What have you tried? Where are you stuck? What part of my suggestion did you not understand that requires an example?
But here's a skeleton that should get you started:
public boolean...
Write a function that takes a String as a parameter and returns whether it contains any digits. Call that function by passing each String into it and taking the appropriate action.