import java.util.Random;
public class RandomDemo {
public static void main(String[] args) {
Random random = new Random();
System.out.println("boolean: " + random.nextBoolean());
System.out.println("int: " + random.nextInt());
System.out.println("double: " + random.nextDouble());
System.out.println("float: " + random.nextFloat());
System.out.println("int (scaled 0-99): " + random.nextInt(100));
}
}
Here you can find stuff related to my interests. Come join me if we share common interests.
Showing posts with label Java: Beginner. Show all posts
Showing posts with label Java: Beginner. Show all posts
Monday, August 10, 2009
Random Number Generator
Subscribe to:
Posts (Atom)