且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

在Java中,如何解析大于int大小的字符串

更新时间:2023-11-05 08:09:40

Integer.parseInt 无法完成工作,除非您很乐意丢失数据.在这里考虑您的要求.

Integer.parseInt couldn't do the job, unless you were happy to lose data. Think about what you're asking for here.

尝试 Long.parseLong(String) new BigInteger(String) 表示真正的大整数.

Try Long.parseLong(String) or new BigInteger(String) for really big integers.