本帖最后由 张向辉 于 2013-2-15 20:22 编辑
package cn.test.hello;
public class IntegerTest {
/**
* @param args
*/
public static void main(String[] args) {
GetInteger ger = GetInteger.getInstance();
ger.integerTest();
}}
class GetInteger {
private GetInteger() {
}
private static GetInteger in = new GetInteger();
public static GetInteger getInstance() {
return in;
}
public void integerTest() {
Integer a = 130;
Integer b = null, sum;
for (int i = 100; i <= 140; i++) {
b = i++;
System.out.println("-------" + b);
}
if (a == b) {
sum = a + b;
}else{
System.out.println("它们没有相等------------");
}
}
}
按道理说它们不应该输出"它们没有相等",我检查了几篇,还是找不到问题,谁能告诉一下我!
|