break out of for loop when it iterates over 4th even number

break out of for loop when it iterates over 4th even number


public static void main(String[] args) {
        for (int i=1; i<=10; i++) {

            if (i%2==0) {
                System.out.println("My Name is Nikki\r\n" + `enter code here`I am learning Core Java");
//          else {
//              System.out.println("My name is U\r\n" + `enter code here`
// I am learning core java");
//          }




java loops

Bootstrap 5 Complete Course with Examples

Bootstrap 5 Tutorial - Bootstrap 5 Crash Course for Beginners

Nest.JS Tutorial for Beginners

Hello Vue 3: A First Look at Vue 3 and the Composition API

Building a simple Applications with Vue 3

Deno Crash Course: Explore Deno and Create a full REST API with Deno

How to Build a Real-time Chat App with Deno and WebSockets

Convert HTML to Markdown Online

HTML entity encoder decoder Online

How to Install OpenJDK 11 on CentOS 8

What is OpenJDK? OpenJDk or Open Java Development Kit is a free, open-source framework of the Java Platform, Standard Edition (or Java SE).

Java For Loop Example | For Loop in Java Tutorial

Java For loop provides a concise way of writing the loop structure. For loop consumes the initialization, condition and increment/decrement in one line.

Java While Loop Example | While Loop In Java

Java while loop evaluates an expression, which must return the boolean value. While statement continues testing the expression and executing its block until that expression evaluates to false. 

Introduction to Loops in Java | Java Loops Beginners | Java Training

Introduction to Loops in Java | Java Loops For Beginners | Java Training

For-each Loop In Java Example | Java Foreach Tutorial

For-each in Java loop is another way for array traversing techniques like the for loop, while loop, do-while loop introduced in Java 5.