Latest News

 










Using Arrays Example

Previous slide Next slide Back to first slide View graphic version


Using Arrays Example


 
My other sites

Latest News

 










Using Arrays Example


    public class InitArrays {
    public static void main (String[] argv) {
    int [] numArray; // declaration
    numArray = new int[10]; // creation
    for (int x=0; x<numArray.length; x++) {
    numArray[x] = x * 2;
    }
    for (int x=0; x<numArray.length; x++) {
    System.out.println("position " + x +
    " contains: " + numArray[x] );
    }
    }
    }

Previous slide Next slide Back to first slide View graphic version