Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public static void hasUpperCase(String str) throws PasswordUpperCase
- {
- boolean hasUpperCase = false;
- //checks the password for an upper case letter
- for (int c = 0; c < str.length() && Character.isUpperCase(c); c++)
- {
- if(Character.isUpperCase(c))
- {
- hasUpperCase = true;
- }
- }
- if (!hasUpperCase)
- {
- throw new PasswordUpperCase();
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment