PGoCareerGoCareer prep tools
Home
LoginSign up
  • Java
  • Python
  • AI
  • React
  • Angular
  • PHP
  • Node.js
  • SQL
  • DSA
  • HTML
  • CSS
  • JS
  • Spring
  • ML
  • MongoDB

Java · Theory

Java Continue

← All stacks

Theory

23/270

Java Continue

continue skips the rest of this round and goes to the next round. The loop does not end. Useful to ignore bad values: skip negatives, skip one id.

In a for loop, after continue the update (i++) still happens. Then the condition is checked again. break exits; continue keeps looping.

Same sample loop, continue at i == 3 vs break at i == 3 — outputs are different. Interviewers love that comparison. Don’t say continue “stops the loop”.

Let's take this on the board with one tiny Main class — no extra files. Java Continue — output: 1, 2, 4, 5. When i is 3, continue skips that print and goes to i++. Start from main, go line by line, and stop at each print. That output is the proof for Continue.

Exam tip

Same loop: continue at i == 3 vs break. Compare output.

Example

// Java Continue
public class Main {
  public static void main(String[] args) {
    for (int i = 1; i <= 5; i++) {
      if (i == 3) {
        continue;
      }
      System.out.println(i);
    }
  }
}

Java Continue — output: 1, 2, 4, 5. When i is 3, continue skips that print and goes to i++.

Short notes

  • Defcontinue skips the rest of this round. Loop continues.
  • RuleIn for, i++ still runs after continue.
  • UseSkip bad / special values.
  • Diffbreak exits. continue skips one round.

Questions

1

Does continue stop the loop?

2

When do you use continue?

3

After continue in for, does i++ still run?

Previous← Java BreakNextJava Comments →
P

GoCareerGo

Utilities · Preparation Hub · Resume · CV · Tools — one workspace.

Workspace

DashboardProfilePreparation HubResume builderCV builderCareer planning

PDF Tools

Merge PDFSplit PDFCompress PDFImage to PDFAll toolsJobs

Image & QR

Compress ImageResize ImageQR ScannerQR GeneratorBlogIT interview prep

Company

FAQFeedbackContactPrivacyTermsSitemap

© 2026 GoCareerGo. Keep moving forward.