求救:由于Comm通讯的底层接口获取的int型整数数据是C++写的,现在要用java调用C++的接口int型出现溢出,即怎么获取大于2147483648(c++可 long型也是一样的报错,不知道为什么? 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 用BigInteger例子:import java.math.BigInteger;public final class Hello { public static void main(String[] args) { BigInteger temp = new BigInteger("2147483649"); System.out.println(temp); }} 等等,刚才没看清位数,不用BigInteger的,用long就可以了。 public static void main(String[] args) { long temp = 2147483649L; System.out.println(temp); }看到214783649后面的L了没有? int型的最大值是2147483648,你用long型肯定不会错的 Java 集合赋值问题! 关于EL表达式的一个小问题,请教 求一个复杂度较优的乘方程序 FLASH提交表单问题 JAVA 基本函数调用 求 java核心技术1(基础知识) 先給分 再問 收郵件附件中文問題 急急急,幫忙看看 java类中包含静态成员、方法时的打印顺序 求助 再问一个关于ObjectInputStream的问题 关于从table读取数据的问题
例子:
import java.math.BigInteger;public final class Hello {
public static void main(String[] args) {
BigInteger temp = new BigInteger("2147483649");
System.out.println(temp);
}
}
public static void main(String[] args) {
long temp = 2147483649L;
System.out.println(temp);
}
看到214783649后面的L了没有?
你用long型肯定不会错的