更新时间:2023-02-11 09:52:01
不可能
long xValue = someValue;
long yValue = someValue;
long otherTolalValue = (long)(xValue - yValue);
3行均不能产生java.lang.ClassCastException
neither of the 3 lines can produce java.lang.ClassCastException
假设someValue是Double,
Assuming someValues is Double,
Double someValue = 0.0;
会出现编译错误:类型不匹配:无法将Double转换为long