• Home
  • About Us
  • Courses
  • Blog
    • ServiceNow
    • Java
    • Web Technologies
    • Amazon Web Services (AWS)
    • DevOps
    • Google Cloud
  • Contact
    • RegisterLogin
      • GET STARTED
    Java4all - ServiceNow, AWS, Java and Cloud TechnologiesJava4all - ServiceNow, AWS, Java and Cloud Technologies
    • Home
    • About Us
    • Courses
    • Blog
      • ServiceNow
      • Java
      • Web Technologies
      • Amazon Web Services (AWS)
      • DevOps
      • Google Cloud
    • Contact
      • RegisterLogin
        • GET STARTED

      Java

      • Home
      • All courses
      • Java
      • Control Statements in Java
      CoursesBackendJavaControl Statements in Java
      • Conditional Control Statements 4

        • Lecture1.1
          If statement 05 min
        • Lecture1.2
          If-else statement 05 min
        • Lecture1.3
          If-else-if statement 10 min
        • Lecture1.4
          Switch statement 05 min
      • Looping Control Statements 3

        • Lecture2.1
          For loop 07 min
        • Lecture2.2
          While loop 05 min
        • Lecture2.3
          Do-while loop 08 min
      • Unconditional Control Statements/Jump Statements 3

        • Lecture3.1
          break statement 10 min
        • Lecture3.2
          continue statement 10 min
        • Quiz3.1
          Control statements in Java Online Test 20 questions

        continue statement

        • continue is a keyword. It is used to continue the execution of the current loop with the next iteration.
        • Syntax: continue; or continue<label>;
        class BBS{ //continue without label
        public static void main(String args[]){
        for(int i=1;i<=4;i++){
        System.out.print(“ “+i+” “);
        if(i==3) continue;
        System.out.println(“BBS Technologies”);}
        } }

        Output:
        1 BBS Technologies
        2 BBS Technologies
        3 4 BBS Technologies

        /* continue with label is used to continue the number of loops below the label */
        class BBS{
        public static void main(String args[]){
        Termi:
        for(int i=1;i<=4;i++){
        for(int k=1;i<=4;k++){
        System.out.print(“ ”+i+” ”);
        if(i==3) continue Termi;
        System.out.println(“BBS Technologies”);
        }
        }
        } }

        Output:
        1 BBS Technologies
        2 BBS Technologies
        3 1 BBS Technologies
        2 BBS Technologies
        3 1 BBS Technologies
        This statement will keep on printing the same output till the memory gets full.

        Prev break statement
        Next Control statements in Java Online Test

        Leave A Reply Cancel reply

        You must be logged in to post a comment.

        All Courses

        • AngularJS
        • AWS
        • Backend
          • J2EE
          • Java
        • J2EE
        • Java
        • ServiceNow

        Latest Courses

        ServiceNow Service Catalog Practice Test

        ServiceNow Service Catalog Practice Test

        Free
        ServiceNow Certified System Administrator Practice Test – Fundamental – 2

        ServiceNow Certified System Administrator Practice Test – Fundamental – 2

        Free
        ServiceNow Certified System Administrator Practice Test – Knowledge Management

        ServiceNow Certified System Administrator Practice Test – Knowledge Management

        Free

        Become an Instructor

        Join our community of students around the world and sell your courses.

        Learn More

        BBS Learning Powered by BBS Technologies.

        • Privacy
        • Terms
        • Sitemap
        • Purchase

        Login with your site account

        Lost your password?

        Not a member yet? Register now

        Register a new account

        Are you a member? Login now