Best way to find the average of some numbers is trying Classes ......
public static void main(String[] args) {
average(1,2,5,4);
}
public static void average(int...numbers){
int total = 0;
for(int x: numbers){
total+=x;
}
System.out.println("Average is: "+(double)total/numbers.length);
}