I think the statement is not about really unreachable code. If you write a
Java program with unreachable code, the Java compiler will show an error on it. Here is an example of unreachable code:
Note that the statement talks about
code that should not be reachable which is not the same as
unreachable code. Sometimes you have a place in your source code where the program can potentially get to, but it shouldn't. The statement says that at such a place it is appropriate to use an assertion. It can happen, for example, when a variable has a value that it shouldn't have. Example:
More examples here:
Programming With Assertions [ August 14, 2007: Message edited by: Jesper Young ]