在Java中,如何在数组中存储大量数字? [英] In Java, how do I store large numbers in an array?
本文介绍了在Java中,如何在数组中存储大量数字?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
在Java中,如何将数字存储在数组中,我的意思是说很长的数字(最多1万亿),因此我可以访问它们并用文字打印出来它们是什么?
In Java, how do I store numbers in an array, I mean really long numbers like up to 1 trillion so I can access them and print out in words what they are?
推荐答案
您需要 BigInteger (如果它真的那么大)。万亿。 长已足够
You need BigInteger if its really that large. For trillion. Long is enough
这篇关于在Java中,如何在数组中存储大量数字?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文