Using Array

package simpleprograms;

public class arrayloop {

public static void main(String[] args) {

int[] arynums;

arynums = new int[6];

arynums[0] = 10;
arynums[1] = 20;
arynums[2] = 30;
arynums[3] = 40;
arynums[4] = 50;
arynums[5] = 60;

System.out.println ( arynums[3] );

}

}

 

Output: 40

1 12 13 14