Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVA

if condition with loop in 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: #condition #loop #java
ADD COMMENT
Topic
Name
3+9 =