簡體   English   中英

如何使用BigInteger值初始化字符串數組?

[英]How to use BigInteger value to initialize String Array?

我正在編寫一個程序,並堅持使用下面的BigInteger問題。

BigInteger noOfCombinationForWordsToBeSearchedBig = factorial(noOfWordsToBeSearched);
String[][] combinationForWordsToBeSearched = new String[ noOfCombinationForWordsToBeSearchedBig.longValue()][noOfWordsToBeSearched];

我想用noOfCombinationForWordsToBeSearchedBig值初始化String[][]數組。

例如,我發現階乘17是一個大整數。

請指教。

數組索引不能超過Java中的Integer.MAX_VALUE 實際上,它比Integer.MAX_VALUE少得多。 因此,實際上在創建數組時不能將BigInteger用作size參數。

有關詳細信息, 請參見此處

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM