Java program to find sum & average of an array