Generate random String in Java
Generate String objects of length 8 containing a-z, A-Z and 0-9 character :
RandomString random = new RandomString();
String string = random.nextString();
Generate String objects of length 16 containing a, b , c and d character :
RandomString random = new RandomString(16, "abcd");
String string = random.nextString();
File: pom.xml
<repositories>
<repository>
<id>jitpack.io</id>
<url>https://jitpack.io</url>
</repository>
</repositories>
File: pom.xml
<dependency>
<groupId>com.github.d-william</groupId>
<artifactId>commons-string-generator</artifactId>
<version>2.0.0</version>
</dependency>