Exercise 5.14 import java.util.Random;
public class RandomTester
{
private Random random; // the random number generator
public RandomTester()
{
random = new Random();
}
public void printOneRandom()
{
System.out.println(random.nextInt());
}
public void printMultiRandom(int howMany)
{
for(int i=0; i<howMany; i++) {
printOneRandom();
}
}
} |