Write a Java program to calculate the average of an array elements