converting string to Integer val

后端 未结 2 424
鱼传尺愫
鱼传尺愫 2021-01-25 17:07

if my String contains 100 digits or 900 digits how can i parse it to Integer value Java.

public static void main(String...args){
    long answer1=-1,answer2=-1;
         


        
2条回答
  •  感情败类
    2021-01-25 17:30

    Integer's MAX_VALUE is 2,147,483,647. Which is 10 digits.

    You can use BigInteger - No Limit, but it depends on your memory and system architecture.

提交回复
热议问题