Professional Documents
Culture Documents
array;
// Declare an array
int intArray[];
// Operation : Insertion
// Add elements in the array
for(int i = 0; i< intArray.length; i++)
{
// place value of i at index i.
System.out.println("Adding "+i+" at index "+i);
intArray[i] = i;
}
System.out.println();
// Operation : Insertion
// Element at any location can be updated directly
int index = 5;
intArray[index] = 10;