package test;
import java.util.Arrays;
public class Test {
public static void main(String[] args) {
Integer[] array = new Integer[]{1, 2, 3, 4, 5, 6};
System.out.println(Arrays.asList(array).stream().mapToInt(Integer::intValue).average().getAsDouble());
}
} |