Example code:
public class test {
public static void main(String[] args) {
if (false) {
System.out.print("if");
} else if (true) {
System.out.print("else-if");
}
}
}
and set breakpoint like the picture:
Then debug it, however, Intellij IDEA doesn't stop at the breakpoint. Why?
This question may be a duplicate of some existing question but I don't think it should be closed as a duplicate of stackoverflow.com/questions/17965562/… because, while the answers may be the same, the questions are phrased differently and only appear as duplicates once you know the answer – Kirby 10 hours ago
and, EVEN IF there exists some compile-time-handle with if statement, the breakpoint should always be hit.