The 'continue' keyword in Java (and probably in many other programming languages) is used to skip further execution of the current iteration.
Why was the name 'continue' chosen? Why not something more straightforward like 'skip' ?
Software Engineering Stack Exchange is a question and answer site for professionals, academics, and students working within the systems development life cycle. It only takes a minute to sign up.Sign up to join this community
While most likely not a very big difference and programmers would have been able to handle it just the same:
"continue" makes it clear that the loop will go on processing data (stop the details, continue the loop), while "skip" could be thought of as terminating the loop totally (like break in C++). It's one of those cases where it can be difficult to find the "perfect" name for some functionality. Ruby and Perl use "next" in similar situations which to me seems a slightly better choice.
I guess it might have to do with history of programming languages.
To ask why it is continue in Java is to ask why it is continue in C++, which is to ask why it is continue in C, Algol etc.
To my knowledge, Fortran was the first to have a CONTINUE statement, actually a no op. It was just there to make it possible to place a (numeric) label used in goto or other constructs like:
DO 42 i=1,100 A[i] = 0 42 CONTINUE
The first line introduces a do loop that, when completed, continued execution at label 42.