Reputation: 73
I am writing a program and stuck with below issue of BigInteger.
BigInteger noOfCombinationForWordsToBeSearchedBig = factorial(noOfWordsToBeSearched);
String[][] combinationForWordsToBeSearched = new String[ noOfCombinationForWordsToBeSearchedBig.longValue()][noOfWordsToBeSearched];
I want to initialize the String[][]
array with value of noOfCombinationForWordsToBeSearchedBig
.
For examaple, i am finding factorial of 17 which is big integer.
Please advise.
Upvotes: 0
Views: 622
Reputation: 7126
Array index can not be more than Integer.MAX_VALUE
in Java. In fact its much less than Integer.MAX_VALUE
. So actually you can not put BigInteger
as the size parameter, while creating an array.
For details see here.
Upvotes: 4