for a empty if-stmt, else-stmt will not be executed
Brought to you by:
cabbey,
daveshields
// Jikes Compiler - Version 1.16 - 10 July 2002
// file: jikes-1.16-windows.zip
// platform:
// window nt 4.0 servicepack 5
// java version "1.3.1_02"
// Java(TM) 2 Runtime Environment, Standard Edition (build 1.3.1_02-b02)
// Java HotSpot(TM) Client VM (build 1.3.1_02-b02, mixed mode)
// Full Error Message:: none, is a runtime error
// Testcase: see class Test
public class Test {
public static void main(String[] args) {
boolean val = false;
if (val) {
System.out.println("val is true");
}
else {
System.out.println("val is false");
}
if (val) {
;
}
else {
// this part will not be executed
System.out.println("val is false");
}
System.exit(0);
}
}
Duplicate.