Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVA

enhance for loop java


public class Sample {
    public static void main(String[] args) {

        String roles[] = { "admin", "customer", "cashier", "manager" };
        // for (int x = roles.length - 1; x > -1; x--) {
        //     System.out.println(roles[x]);
        // }
        for (String n : roles) {
            System.out.println(n);
        }
    }

}
 
PREVIOUS NEXT
Tagged: #enhance #loop #java
ADD COMMENT
Topic
Name
2+4 =