File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Beginning Java and the fly likes random Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "random" Watch "random" New topic


nil lin

Joined: May 04, 2004
Posts: 4
How to send out card(arbitrarily)??
Can I use "random"?and how to use it?
thanks a lot!
Ananth Ram
Ranch Hand

Joined: Jan 18, 2001
Posts: 99
You could do that with the help of Math.random()......
Dirk Schreckmann

Joined: Dec 10, 2001
Posts: 7023
Take a look at the J2SE API documentation. Note that to generate a random number, you could make use of Math.random(), as suggested, or the class Random.

Are you able to figure out how to generate the random numbers you want after looking at the documentation of these two classes? If you're having trouble, just ask for more assistance, and be sure to post any code that you're working on.

[How To Ask Good Questions] [JavaRanch FAQ Wiki] [JavaRanch Radio]
I agree. Here's the link:
subject: random
It's not a secret anymore!