String s = "10000001004"; String d = "1000000104";
字符串超过10位的用long接收,不超过的用int 接收
int j = Integer.valueOf(d).intValue(); Long i = Long.valueOf(s);
运行结果:
- public class Test {
- public static void main(String[] args) {
- // 2的31次方
- int j = (int) Math.pow(2,31);
- System.out.println("j的值" + j);
- }
- }
j的值2147483647