🌐
GitHub
github.com › igr › nomen-est-omen
GitHub - igr/nomen-est-omen: Random names generator, with a style. · GitHub
"Your name is your destiny", so be sure you pick a good name. This Java library helps with generating some super-awesome random names that you can use for some unique IDs or passwords :)
Starred by 47 users
Forked by 4 users
Languages   Java
🌐
GitHub
github.com › ajbrown › name-machine
GitHub - ajbrown/name-machine: Generate realistic random American male and female names. · GitHub
Name machine is a Java utility for generating random names with realistic probabilities of occurrence.
Starred by 56 users
Forked by 9 users
Languages   Java 93.7% | Groovy 6.3%
Discussions

random - Java: Randomly generate distinct names - Stack Overflow
I need to generate 10,000 unique identifiers in Java. The identifiers should be a mixture of numbers and letters and less than 10 characters each. Any ideas? Built in libraries would be an extra plus. More on stackoverflow.com
🌐 stackoverflow.com
[Java] I wrote a random name generator
Overall, looks pretty good! A few things I noticed: Make sure you are very intentional with your pluralization. For example, in the line Name names = new Name(), you have inconsistent pluralization. Which is it — one name, or multiple names? In Name, you have some places where you have hardcoded the length of some of your various arrays. This isn't good, because this means that if you want to update the contents of one of the arrays, you will have to change multiple places in your code, where you should only need to change one place in your code for such a change. Similarly, in UserInterface, you have one area that prints out a numbered list of all the actions that the user can choose from, but the logic that goes along with each of those actions is elsewhere in the file. It would be good to use a data structure such that if you needed to add an action, remove an action, or rearrange the actions, you could do so by only making one edit to the code, not multiple edits. More on reddit.com
🌐 r/learnprogramming
18
13
July 1, 2025
Generate Heroku-like random names to use in your Java applications (github.com/atrox/haikunatorjava)

Any thoughts on why you went with a Map<String,Object> for configuration instead of a builder, a configuration object, or a set of constructors? I suspect you are using a Map in order to mimic Ruby's option hash, but this isn't idomatic Java and seems a bit error-prone. If you must use the Map for configuration, I'd at least provide some constants. Or an enumeration and change the configuration to Map<MyEnum,Object> to constrain the types. But I'd see about losing the Map in favor of something else.

Also, it would be nice to provide a way to actually change the words being used. Hard coding them into the app doesn't provide as much value. As a user, I should be able to configure the word lists.

Don't let this discourage you, keep working.

Edit: If you are only using one method (StringUtils.join) from Apache Commons, I'd consider dropping the dependency and writing my own join method. But that's fairly subjective and I don't like having many dependencies if I can avoid them.

More on reddit.com
🌐 r/java
6
20
April 28, 2015
Name generator and several bugs

So you need to format your code and give a more specific issue. You made the class but put nothing inside it but maybe you left that out. Anyway Character is already a thing in Java so maybe first try a new name.

More on reddit.com
🌐 r/learnjava
4
4
May 24, 2021
🌐
GitHub
github.com › folkengine › java-random-name-generator
GitHub - folkengine/java-random-name-generator: Generates random names from syllables
March 21, 2016 - Generates random names from syllables. Contribute to folkengine/java-random-name-generator development by creating an account on GitHub.
Starred by 5 users
Forked by 2 users
Languages   Java 100.0% | Java 100.0%
🌐
GitHub
gist.github.com › LordAmit › f91471536ca320395420
A random name generator written in Java. Did it for fun :| · GitHub
April 7, 2015 - A random name generator written in Java. Did it for fun :| - NameGenerator.java
🌐
GitHub
github.com › mperalc › name-generator
GitHub - mperalc/name-generator: Java library to generate random name(s) from different languages/cultures
Java library to generate random name(s) from different languages/cultures - mperalc/name-generator
Author   mperalc
🌐
GitHub
github.com › kohsuke › wordnet-random-name
GitHub - kohsuke/wordnet-random-name: Human friendly random name generator for tests
This little library generates human friendly random identifiers. For example, given the following code, RandomNameGenerator rnd = new RandomNameGenerator(0); for (int i=0; i<10; i++) System.out.println(rnd.next()); ... constructive_carrot ...
Starred by 137 users
Forked by 34 users
Languages   Java 100.0% | Java 100.0%
🌐
GitHub
github.com › arakelian › faker
GitHub - arakelian/faker: A Java library for generating fake data such as names, addresses, and phone numbers. · GitHub
Faker is library for generating high-quality fake data, such as names, addresses and phone numbers. Faker is still under development, and will evolved in the coming months. Using Faker is very easy. ... Let's generate a random person.
Starred by 25 users
Forked by 2 users
Languages   Java
🌐
GitHub
github.com › hanleybrand › xnamer
GitHub - hanleybrand/xnamer: a simple random name generator with big dreams - Java or Python
a simple random name generator with big dreams - Java or Python - hanleybrand/xnamer
Author   hanleybrand
Find elsewhere
🌐
GitHub
github.com › devcexx › name-generator-java
GitHub - devcexx/name-generator-java: Simple generic name generator developed in Java. · GitHub
This is a simple utility that allows to generate any kind of random names based on another set of names.
Author   devcexx
🌐
GitHub
github.com › xdrop › jRand
GitHub - xdrop/jRand: A Java library to generate random data for all sorts of things. Java random data faker
JRand is heavily inspired by ChanceJS and tries to bring together a lot of that functionality to Java. In JRand there are Generator's which are reusable components to generate all sorts of things. You can get access to any generator you wish via the JRand facade class. The library is still under development with weekly releases of new generators. Builder style random data generators with a lot of options
Starred by 27 users
Forked by 14 users
Languages   Java 73.0% | Groovy 20.1% | Kotlin 6.7% | Shell 0.2% | Java 73.0% | Groovy 20.1% | Kotlin 6.7% | Shell 0.2%
🌐
Baeldung
baeldung.com › home › testing › a guide to javafaker
A Guide to JavaFaker | Baeldung
May 11, 2024 - compile group: 'com.github.javafaker', name: 'javafaker', version: '0.15' The FakeValueService class provides methods for generating random sequences as well as resolving .yml files associated with the locale.
🌐
Open Hub
openhub.net › p › janag
The JaNaG - Java Name Generator Open Source Project on Open Hub
JaNaG (Java Name Generator) is a random name generator for role-games, authors, and the like. It is based on a name fragment database that creates relatively reasonably sounding names from different cultures/influences (e.g. elves, orcs, pseudo-old-German, etc.).
🌐
GitHub
github.com › ajbrown › name-machine › blob › master › src › main › java › org › ajbrown › namemachine › NameGenerator.java
name-machine/src/main/java/org/ajbrown/namemachine/NameGenerator.java at master · ajbrown/name-machine
import java.util.Random; import java.util.TreeMap; import java.util.logging.Level; import java.util.logging.Logger; · /** * NameGenerator can generate realistic American male and female full names. It uses U.S. Census data to ensure that · * more common names will appear more often.
Author   ajbrown
🌐
GitHub
github.com › namics › java-random
GitHub - merkle-open/java-random
This works for types with available generators · Integer random = RandomData.random(Integer.class); But also for Java beans: public class Demo { public static class Person{ private String name; public String getName() {return name;} public void setName(String name) {this.name = name;} } @Test public void simplePerson() throws Exception { Person person = RandomData.random(Person.class); System.out.println(person.getName()); // Leonel Bowers } } This requires a registered instance of com.namics.commons.random.generator.RandomGenerator<SupportedType> for the requested type.
Starred by 21 users
Forked by 8 users
Languages   Java 97.9% | Shell 2.1% | Java 97.9% | Shell 2.1%
🌐
GitHub
github.com › topics › name-generator
name-generator · GitHub Topics · GitHub
A Java implementation of various procedural name generation algorithms, including combinatorial, consonant vowel, context-free grammar, and Markov chain. generator procedural-generation grammar markov-chain roguelike procedural name name-generation ...
🌐
Reddit
reddit.com › r/learnprogramming › [java] i wrote a random name generator
r/learnprogramming on Reddit: [Java] I wrote a random name generator
July 1, 2025 -

Hey there! I recently started learning java a couple weeks ago as my first language, mostly out of interest in developing some mods for minecraft. After getting comfortable with java, I intend to learn C# and pursue other interests involving game development.

At any rate, I've always loved coming up with unique names. So I thought why not challenge myself with writing a random name generator that doesn't just spit out nonsense. I feel comfortable calling the project complete for now although I could add more and more functionality, I do want to get on with continuing to learn.

I would appreciate feedback on my coding, even if it's a fairly simple project. Am I doing things moderately well? Does anything stand out as potentially problematic in the future if I carry on the way I have here? Am I writing too much useless or needless code? I am trying to ensure I don't solidify any bad habits or practices while I'm still learning fresh.

The project is at https://github.com/Vember/RandomNameGenerator

Greatly appreciate any feedback!

Top answer
1 of 2
3
Overall, looks pretty good! A few things I noticed: Make sure you are very intentional with your pluralization. For example, in the line Name names = new Name(), you have inconsistent pluralization. Which is it — one name, or multiple names? In Name, you have some places where you have hardcoded the length of some of your various arrays. This isn't good, because this means that if you want to update the contents of one of the arrays, you will have to change multiple places in your code, where you should only need to change one place in your code for such a change. Similarly, in UserInterface, you have one area that prints out a numbered list of all the actions that the user can choose from, but the logic that goes along with each of those actions is elsewhere in the file. It would be good to use a data structure such that if you needed to add an action, remove an action, or rearrange the actions, you could do so by only making one edit to the code, not multiple edits.
2 of 2
2
Actually quite a fun project, and it is obvious that you've had fun playing around with making the code - that's a good thing! This is only comments for the UserInterface, and mostly ideas for further improvements. I like the processCommand method, and you should take it further still, and make separate methods for each command - like generateRandom, generateWithLength, generateWithLetter, or what you prefer to name them, and then only let processCommand decide which of them to call. Also, not sure why you use Integer.valueOf to test the value of ints, usually writing if (command == 1) should be sufficient. You might want to use a switch-case for the commands instead of a chain of if-statements. It might make the code look better, something like: switch(command) { case 1 -> generateRandom(); case 2 -> generateWithLength(); case 3 -> generateWithLetter(); and so on. But it is a matter of taste. You could benefit from making a single method for reading a valid number from the input - something like: getValidInput(int[] numbers) that would only return one of the numbers in the array, or zero if something else was entered by the user. That would isolate your use of scanner to that method alone, and make the rest of the code easier to write without having to handle exceptions or different invalid inputs. It is always a good idea to have a lot of small methods that only do one thing - my own personal rule is that if I have more than two levels of if-statements or loops, I need to make a method to combine them. The less indentation the better :)
🌐
GitHub
github.com › andygibson › datafactory
GitHub - andygibson/datafactory: Java library for generating test data
For the single word method, if there are no words in the dictionary of suitable length, then a word is generated using random characters. Changing the test data values produced The data used to generate the values come from classes that can be replaced with other versions. For example, the name values can be changed by providing the DataFactory instance with an object that implements the NameDataValues interface.
Starred by 171 users
Forked by 57 users
Languages   Java 100.0% | Java 100.0%
🌐
Medium
reedanna.medium.com › creating-a-simple-random-generator-in-java-43d2ac47543c
Creating a Simple Random Generator in Java | by Anna Reed | Medium
January 8, 2021 - Some of these are messy — note the genasi case, which uses my pickFromTwo function to actually pick from five different racial name options: human, elf (both thanks to the half-elf case below it), gnome, dwarf, and halfling. Were this a larger project that I was working with multiple people on, I would definitely want to add in more code comments to make sure it was clear what was happening in each block. The full code — and, by extension, the program, if you want to randomly generate some character ideas yourself — is available here at Github.
🌐
GitHub
github.com › topics › random-number-generators
random-number-generators · GitHub Topics · GitHub
java random random-generation random-number-generators random-data-generation ... This is a simple random number generator app that lets the user set the range in which the numbers will start and end from · android beginner-project ...