2 AnswersNew Answer
There are things like RandomStringGenerator. But if you would like to make it from scratch.... The simplest way to do so, would be to make a string of all the characters you want to be in the string, and then choose random index from the string. Alternatively you could generate random int in the range of the characters you want to use(ASCII table) And then just convert it to char.
These type of questions can be easily found on the internet by just a simple search https://www.educative.io/edpresso/how-to-generate-random-numbers-in-java All the best =)