Coding, Linux, Hacking Security, Learning!
Generating random numbers in Java
you need header
java.util.Random;Random diceRoller = new Random();
for (int i = 0; i < 10; i++) { int roll = diceRoller.nextInt(6) + 1; System.out.println(roll);
}
| Print article | This entry was posted by admin on March 6, 2010 at 7:33 pm, and is filed under java random number. Follow any responses to this post through RSS 2.0. You can leave a response or trackback from your own site. |