Search
 
SCRIPT & CODE EXAMPLE
 

JAVA

java reverse loop


    for (int i = aList.size() - 1; i >= 0; i--) {
        String s = aList.get(i);
    }
Comment

reverse loop in java

public class Reverse {

  public static void main(String [] args){
    int i, j;

    System.out.print("Countdown
");

    int[] numIndex = new int[10]; // array with 10 elements.

    for (i = 0; i<10 ; i++) {  // from 0 to 9
      numIndex[i] = i;// element i = number of iterations (index 0=0, 1=1, ect.)
    }

    for (j=9; j>=0; j--){ // from 9 to 0
      System.out.println(numIndex[j]);//indexes should print in reverse order from here but it throws an exception?   
    } 

  }
}
Comment

PREVIOUS NEXT
Code Example
Java :: android get sdk version 
Java :: queue and stack reader 
Java :: iterate over multi array java 
Java :: pass a function as parameter 
Java :: input using stringbuffer 
Java :: java find duplicate element in list 
Java :: bfs java 
Java :: and roid shape setCornerRadii 
Java :: how to create char type with jpa 
Java :: public static void main(String[] args) in java 
Java :: java fields 
Java :: jaccard index two vectors R 
Java :: java easy list 
Java :: How to get the nth Fibonacci number code in Java using recursion with memoization 
Java :: transformer un string en Biginteger java 
Java :: integer parse int exceptions 
Java :: how to spilt the string with comma in jaav 
Java :: java unique queue 
Java :: potenzieren java 
Java :: how to run few methods of class after mockStatic 
Java :: module java.base does not "opens java.io" to unnamed module 
Java :: how to translate java swing 
Java :: create a border java 
Java :: java list tostring 
Java :: Compare two csv files using java 
Java :: How to efficiently find the diameter of a binary tree, in Java? 
Java :: how to find odd and even in a array 
Java :: java double to string fixed precision 
Java :: firebase realtime database get key 
Java :: java questions 
ADD CONTENT
Topic
Content
Source link
Name
3+6 =