Accepted answer
int[] intArray = new int[100];

for (int i = 0; i < intArray.length; i++) {  
intArray[i]=i;
}

you can use a map:

String[] cur = { "A", "B" };
Map<String, String> map = new HashMap<String, String>;
for (String name : cur)
    map.put(name, "Blah");
}

You can use below code

int[] testarray = new int[50];

for (int i = 0; i < 50; i++) {  
    testarray[i] = i;
}

or this one also:

int[] testarray = new int[50];

for (int i = 0; i < testarray.length; i++) {  
    testarray[i] = i;
}