// Should be compiled with javac from JDK1.3 to get bytecode which shows the problem. publicclass Test6897150 { publicstaticvoid main(String[] args) { // This works
loopAndPrint(Integer.MAX_VALUE -1); // This doesn't
loopAndPrint(Integer.MAX_VALUE);
}
staticvoid verify(int max, int a) { if ( a != (max - 1)) {
System.out.println("Expected: " + (max - 1));
System.out.println("Actual : " + a);
System.exit(97);
}
} staticvoid loopAndPrint(int max) { int a = -1; int i = 1; for (; i < max; i++) {
a = i;
}
verify(max, a);
}
}
Messung V0.5 in Prozent
¤ Dauer der Verarbeitung: 0.9 Sekunden
(vorverarbeitet am 2026-06-10)
¤
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.