unreachable statement

The Unreachable statements refers to statements that won’t get executed during the execution of the program are called Unreachable Statements. These statements might be unreachable because of the following reasons:
* Have an infinite loop before them: Suppose inside “if” statement if you write statements after break statement, then the statements which are written below “break” keyword will never execute because if the condition is false, then the loop will never execute. And if the condition is true, then due to “break” it will never execute, since “break” takes the flow of execution outside the “if” statement.
* Any statement after throwing an exception: If we add any statements in a try-catch block after throwing an exception, those statements are unreachable because there is an exceptional event and execution jumps to catch block or finally block. The lines immediately after the throw is not executed.
* Any statement after writing continue : If we add any statements in a loop after writing the continue keyword, those statements are unreachable because execution jumps to the top of the for loop. The lines immediately after the continue is not executed.

Java have compilation error for unreachable statement.