1 trillion is not that big - just use long , which can store a number in size 9223372036854775807 (more than a quintillion):
long[] numbers = new long[1000];
To save arbitrarily large numbers, use BigInteger , but they can be tricky:
BigInteger[] numbers = new BigInteger[1000];
source share