Search
 
SCRIPT & CODE EXAMPLE
 

JAVA

java for loop high to low

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 :: statement delete sql java 
Java :: change port in spring boot 
Java :: com.android.builder.dexing.DexArchiveMergerException: 
Java :: java selenium new window 
Java :: get intent not working in fragment 
Java :: toast java example 
Java :: datentypen java 
Java :: spigot run task later 
Java :: java format 2 decimal places 
Java :: convert string to list java 8 
Java :: java how to find length of int 
Java :: @SpringBootApplication 
Java :: java timestamp 
Java :: hibernate dependency 
Java :: moving text in textview android 
Java :: InetAddress.getByAddress example 
Java :: Access denied finding property "camera.aux.packagelist" 
Java :: flutter request location permission 
Java :: libgdx move camera with touch 
Java :: android studio linearlayout set margin 
Java :: how to remove java from ubuntu 
Java :: how to constraint layout parm programmatically in android 
Java :: maven compiler plugin for java 13 
Java :: java double 2 decimal 
Java :: consolenausgabe java 
Java :: java parse string to list using gson 
Java :: how to create a list in java 
Java :: java localdate zoneid example 
Java :: spring data rest format time 
Java :: Do not treat position as fixed; only use immediately and call `holder.getAdapterPosition()` to look it up later 
ADD CONTENT
Topic
Content
Source link
Name
1+8 =