本文介绍了Java问题 - 背后的原因和可能的输出是什么的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

1。)

long milli=24*60*60*1000;
long micro=24*60*60*1000*1000;
long result=micro/milli;

结果应为 1000 但不是。

请告诉我输出并解释一下吗?

Please can you tell me the output and explain it?

2)

int i=0;
for(a=0;a<=integer.MAX_VAL;a++)
{
    i++;
}

S.O.P(i);

通常它会进入infine循环,因为它有最大值它应该从循环中出来。在什么条件下它会成功执行,什么是例外价值。 .....任何人都可以告诉我关于VM ...在JAVA中处理数字

Normally it went to infine loop why because there is max value it should come out of loop. At what conditions it will executed sucessfully and what will be excepted value. .....Anyone can tell me about VM... handing of nummbers in JAVA

推荐答案

你需要放一个 L 在那里进行长期转换

You need to put an L in there for long-conversion

long micro=24*60*60*1000*1000L

这篇关于Java问题 - 背后的原因和可能的输出是什么的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-31 17:36