Array 2

PROGRAM:

public class Number1 {
int i;
int arr[] = new int[10];
void add(){
            int j = 100;
            for(i=0;i<arr.length; i++){
                        arr[i] = j;
                        j++;
            }
}
void show(){
            for(i=0;i<arr.length;i++){
                        System.out.println("The"+i+"array element is" +arr[i]);
            }
}
public static void main(String args[]){
            Number1 a = new Number1();
            a.add();
            a.show();
}
}

OUTPUT:
The0array element is100
The1array element is101
The2array element is102
The3array element is103
The4array element is104
The5array element is105
The6array element is106
The7array element is107
The8array element is108

The9array element is109