how to test a prime number 1000 digits long?

algorithm, java

Solution

If it is sufficient to determine whether or not a number is PROBABLY prime, you can use the built in isProbablePrime function

- if the call returns true, the probability that the number is prime exceeds (1 - 1/(2^certainty)).

- If the call returns false, the number is definately not prime.

Problem

I am trying to find whether number is prime or not for 1000 digit long. Algorithm i am thinking to use is 6k+/-1 problem i am facing is how can i store such a long number in java, it is taken string as input. or for doing divisibility should is consider only the last few digits of the number. please advise

Original source