I have a string named string1 that I read from a file. It's actually a number that I'm reading from the file. I now need to use that number in a random number generator. How can I do that?
String string1 = in.readLine();
Random generator = new Random();
int x = generator.nextInt(string1);
That obviously fails but I can't figure out how to make it work.