Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions Others/PasswordGen.java
Original file line number Diff line number Diff line change
Expand Up @@ -35,13 +35,13 @@ static String generatePassword(int min_length, int max_length) {

// Inbuilt method to randomly shuffle a elements of a list
Collections.shuffle(letters);
String password = "";
StringBuilder password = new StringBuilder();

// Note that size of the password is also random
for (int i = random.nextInt(max_length - min_length) + min_length; i > 0; --i) {
password += letters.get(random.nextInt(letters.size()));
password .append( letters.get(random.nextInt(letters.size())));
}

return password;
return password.toString();
}
}
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ You can run and edit the algorithms or contribute to them using Gitpod.io, a fre
[![Open in Gitpod](https://gitpod.io/button/open-in-gitpod.svg)](https://gitpod.io/#https://github.com/TheAlgorithms/Java)


### All algorithms are implemented in Java (for education purposes)
### All algorithms are implemented in Java (for educational purposes)
These implementations are for learning purposes. The implementations may be less efficient than the Java standard library.

## Contribution Guidelines
Expand Down