How can I have a list in java with larger than integer space

前端 未结 2 399
失恋的感觉
失恋的感觉 2021-01-24 18:51

I am using java.util.List in java for storing a results of my calculation

How can I store values for indexes bigger than maximum integer? (eg large)

2条回答
  •  孤独总比滥情好
    2021-01-24 19:12

    The short answer is, you will not be using the java.util.List interface. You will have to implement something else.

    If it was my program, and if it was not tailored for some specific supercomputing environment, then I would seriously consider using a database instead of trying to store more than two billion objects in RAM.

提交回复
热议问题