coreservlets
Class Primes
java.lang.Object
|
+--coreservlets.Primes
- public class Primes
- extends Object
A few utilities to generate a large random BigInteger,
and find the next prime number above a given BigInteger.
Taken from Core Servlets and JavaServer Pages
from Prentice Hall and Sun Microsystems Press,
http://www.coreservlets.com/.
© 2000 Marty Hall; may be freely used or adapted.
| Methods inherited from class java.lang.Object |
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait |
Primes
public Primes()
nextPrime
public static BigInteger nextPrime(BigInteger start)
random
public static BigInteger random(int numDigits)
main
public static void main(String[] args)
- Simple command-line program to test. Enter number
of digits, and it picks a random number of that
length and then prints the first 50 prime numbers
above that.
 |
|---|
| CSAJSP @ amazon.com |
|---|