public class TestArray {
public static void main(String[] args) {
int a\[\] = new int\[5\]; //Declaration and initialiation
**a = {10, 20, 30, 40, 50}; //Initialization**
//Traversing array
for (int i = 0; i \< a.length; i++) { //length is the property of array
System.out.println(a\[i\]);
}
//Average calculation
float sum = 0, avg;
for (int i = 0; i \< a.length; i++) //Calculating the sum of the numbers
sum += a\[i\];
avg = sum/a.length;
System.out.println("Average = " + avg);
}
}