boolean isValidPassword(String password) { boolean result = false; if(isValidLength(password) && isUpperLetterPresent(password) && isLowerCaseLetterPresent(password) && isSpecialLetterPresent(password)) { result = true; } return result; } boolean isUpperLetterPresent(String password) { boolean result = false; char[] charArray = password.toCharArray(); for(char ch : charArray) { if(Character.isUpperCase(ch)) { result = true; break; } } return result; } boolean isLowerCaseLetterPresent(String password) { boolean result = false; char[] charArray = password.toCharArray(); for(char ch : charArray) { if(Character.isLowerCase(ch)) { result = true; break; } } return result; } boolean isSpecialLetterPresent(String password) { boolean result = false; char[] charArray = password.toCharArray(); for(char ch : charArray) { int type = Character.getType(ch); if(type == Character.OTHER_PUNCTUATION) { result = true; break; } } return result; } boolean isValidLength(String password) { boolean result = false; char[] charArray = password.toCharArray(); if(charArray.length > MINIMUM_LENGTH) { result = true; } return result; }