+ 2
What exactly is continue?
In a if statement please tell me meaning of continue
4 Respostas
+ 3
"continue" has nothing to do with "if". continue tells the computer to skip the remainder of the currently running loop and start with the next iteration.
+ 3
In general If you tell your program to search an answer using loops or switch statements, it will find the answer if exists or will through an error as you written
So what is the use of "continue"
Its the way you are telling your program to continue even though it finds your answer
we have another word "break"
Its the way you are telling your program to stop or break when it finds your answer
+ 2
its actually in a loop when you use continue, not if statement
continue means basically skip that specific iteration. its easier if i give an example
int i = 0;
while (i < 5) {
if (i == 3) {
continue;
}
System.out.println (i);
i++;
}
so this prints
0
1
2
4
5
0
OK Thanks