I'm trying to make the program generate a digit from 97-122, then convert the integer into a char then combine all the char together, but I have no idea how to combine all the char together. My code is
if(UserInput.equals("1")) for(int LowerLAmount = 1; LowerLAmount <= passLength;LowerLAmount++) { int randomLower = (int)((Math.random()*(25))+(97)); System.out.println( (char)randomLower); }
So the LowerLAmount is the user input of how many char there should be, for example, if the user input "8" the loop would run 8 time and generate 8 random number from 97-122 ( hence the Math.random), then I want to turn the integer that was generated into char. For example let say the user input "2", the loop when generate 2 number from 97-122. Let say it generate 97 and 98. I would then want to convert the 97 and 98 into char, which would be "a" and "b". Next I want to combine the two together so it print out "ab". Thanks