import org.apache.commons.lang.RandomStringUtils; public class MainClass { public static void main(String[] args) { //Random 8 chars string from within the characters ABCDEF System.out.print("1) 8 char string using chars ABCDEF >>>"); System.out.println(RandomStringUtils.random(8, "ABCDEF")); } }
1) 8 char string using chars ABCDEF >>>FAADCDAF