24.01.2014 Views

Arrays

Arrays

Arrays

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Pseudo-random Number Generator<br />

pseudo-random numbers<br />

How to generate pseudo-random numbers in Java:<br />

java.util.Random<br />

Random generator = new Random(); // Create an object of class Random<br />

nextInt()<br />

Random<br />

int newNumber = generator.nextInt(); // random number in the interval<br />

// [-2 31 , 2 31 -1]<br />

number in the interval [0, -1].<br />

nextInt()

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!