I'm pretty new to Java and this website, and I'm sorry if this question has already been asked but if it isn't to hard, an answer would be extremely helpful.
Asked
Active
Viewed 160 times
-4
-
5Look to the right, in `Related`. – Sotirios Delimanolis Feb 25 '14 at 23:30
-
1Hi. Have you tried anything yet? Or done any research? Or used the search facility on this site? – Oliver Charlesworth Feb 25 '14 at 23:30
-
I think this answer is what you are looking for: http://stackoverflow.com/a/1377218/783510 – Philipp Claßen Feb 25 '14 at 23:33
1 Answers
0
Psuedocode
import java.util.Random;
import java.util.Scanner;
...
private Random rand = new Random();
private Scanner scan = new Scanner();
...
public static int randomInt() {
return rand.nextInt(scan.nextInt());
}

jpdymond
- 1,517
- 1
- 8
- 10