Basically, the continue keyword will re-execute the condition for while or do loop and also, update the expression for the for loop. It is usually used for early termination of the loop processing and also comes into play to prevent deeply-nested if statements. You can take the below code as a reference:
while (getNext(line)) {
if (line.isEmpty() || line.isComment())
continue;
// More code here
}
I hope this will help.
Want to become a Java Expert? Join Java Training now!!
Want to know more about Java? Watch this video on Java Tutorial for Beginners | Java Programming :