Java error unreachable statement
In this Tutorial we want to describe you a code that help you in understanding a unreachable statement. For this we have a class name' unreachable error', Inside the main method we have a for loop that has a variable integer I.;. The System.out.println is used to display the value of variable integer i on command prompt. The continue statement in the code prevent from the normal execution of the code. The only difference between the continue and break statement is that break statement exits the control of the expression from the loop, but continue statement put the expression in the loop but without executing the code written after the continue statement. This code show you how the statement become unreachable after continue statement.
On the execution of a program, the output on the command prompt is displayed as
To resolve this error remove continue; from this program