请考虑下面的代码片段
public class ConstantFolding {
static final int number1 = 5;
static final int number2 = 6;
static int number3 = 5;
static int number4 = 6;
public static void main(String[ ] args) {
int product1 = number1 * number2; //line A
int product2 = number3 * number4; //line B
}
}标记为行A的行和标记为行B的行之间有什么区别?
发布于 2012-05-10 15:24:42
发布于 2012-05-10 15:24:15
没有区别,product1和product2都等于30。
这条消息打击了你,因为你不能在没有任何解释的情况下发布代码语句。
https://stackoverflow.com/questions/10529203
复制相似问题