Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVA

conditions in for loop java


public class Sample {
    public static void main(String[] args) {
        String names[] = { "Jasmine", "Lyka", "Marbie", "Efren", "Tiny", "Soleen" };
        for (int i = 0; i < names.length; i++) {
            if (names[i].equals("Efren")) {
                System.out.println("We found " + names[i]);
                break;
            }
        }
    }
}
 
PREVIOUS NEXT
Tagged: #conditions #loop #java
ADD COMMENT
Topic
Name
9+8 =