📅  最后修改于: 2022-03-11 14:45:59.591000             🧑  作者: Mango
class ArrayUsingLoop
{
public static void main (String[] args)
{
int[] newArray;
newArray= new int[5];
newArray[0] = 1;
newArray[1] = 2;
newArray[2] = 3;
newArray[3] = 4;
newArray[4] = 5;
for (int i = 0; i < newArray.length; i++)
System.out.println("Array Element at index " + i +
" : "+ newArray[i]);
}
}