diff --git a/java/RandomPassword/PasswordGenerator.class b/java/RandomPassword/PasswordGenerator.class new file mode 100644 index 0000000..86ac20c Binary files /dev/null and b/java/RandomPassword/PasswordGenerator.class differ diff --git a/java/RandomPassword/PasswordGenerator.java b/java/RandomPassword/PasswordGenerator.java index 6ece853..c7dd0f6 100644 --- a/java/RandomPassword/PasswordGenerator.java +++ b/java/RandomPassword/PasswordGenerator.java @@ -7,7 +7,7 @@ import java.util.ArrayList; import java.util.List; class PasswordGenerator { - private static final int DEFAULT_PASSWORD_LENGTH = 4; + private static final int DEFAULT_PASSWORD_LENGTH = 3; public static void main(String[] args) { try { @@ -41,11 +41,15 @@ class PasswordGenerator { for (int i = 0; i < length; i++) { int randomIndex = random.nextInt(dictionary.size()); String word = dictionary.get(randomIndex); - passwordBuilder.append(word); + passwordBuilder.append(toCamelCase(word)); if ( i < length-1) { passwordBuilder.append("/"); } } return passwordBuilder.toString(); } + + private static String toCamelCase(String inputString) { + return inputString.substring(0,1).toUpperCase() + inputString.substring(1).toLowerCase(); + } } diff --git a/java/RandomPassword/passwordgenerator b/java/RandomPassword/passwordgenerator new file mode 100755 index 0000000..e93d008 Binary files /dev/null and b/java/RandomPassword/passwordgenerator differ