Random numbers are useful in many contexts in programming.
One common use is in games, and another is for testing program algorithms such as those used in searching or sorting. Whether such a stream of random numbers are in fact truly random is an interesting question beyond the scope of this discussion. If you're interested in that question you might consult Knuth's book. Our Services Back to Home Page Java and all Java-based marks are trademarks or registered trademarks of Sun Microsystems, Inc. in the United States and other countries. Throughout this document, when the Java trademark appears alone it is a reference to the Java programming language.