in Education by
List numbers = Arrays.asList(3, 2, 2, 3, 7, 3, 5);

1 Answer

0 votes
by

List<Integer> numbers = Arrays.asList(3, 2, 2, 3, 7, 3, 5);

IntSummaryStatistics stats = integers.stream().mapToInt((x) -> x).summaryStatistics();

System.out.println("Average of all numbers : " + stats.getAverage());

Related questions

0 votes
    List numbers = Arrays.asList(3, 2, 2, 3, 7, 3, 5);...
asked Nov 8, 2020 in Education by Editorial Staff
0 votes
    List numbers = Arrays.asList(3, 2, 2, 3, 7, 3, 5);...
asked Nov 8, 2020 in Education by Editorial Staff
0 votes
    List numbers = Arrays.asList(3, 2, 2, 3, 7, 3, 5);...
asked Nov 8, 2020 in Education by Editorial Staff
0 votes
    List numbers = Arrays.asList(3, 2, 2, 3, 7, 3, 5);...
asked Nov 8, 2020 in Education by Editorial Staff
0 votes
    How is Arrays.asList() different than the standard way of initialising List? (a) Both are same (b) ... Collections Framework of Java Select the correct answer from above options...
asked Mar 1, 2022 in Education by JackTerrance
0 votes
    How is Arrays.asList() different than the standard way of initialising List? (a) Both are same (b) ... programming questions and answers pdf, java interview questions for beginners...
asked Oct 25, 2021 in Education by JackTerrance
0 votes
    List strings = Arrays.asList("abc", "", "bc", "efg", "abcd","", "jkl");...
asked Nov 8, 2020 in Education by Editorial Staff
0 votes
    Liststrings = Arrays.asList("abc", "", "bc", "efg", "abcd","", "jkl");...
asked Nov 8, 2020 in Education by Editorial Staff
0 votes
    A game of chance consists of spinning an arrow, which comes to rest pointing at one of the numbers 1, 2, 3, 4, ... at any factor of 8. Select the correct answer from above options...
asked Nov 23, 2021 in Education by JackTerrance
0 votes
    A game of chance consists of spinning an arrow, which comes to rest pointing at one of the numbers 1,2,3,4,5,6 ... at any factor of 8. Select the correct answer from above options...
asked Nov 17, 2021 in Education by JackTerrance
0 votes
    >>> list(range(0, -9,-1)) will print [-1, -2, -3, -4,-5, -6, -7, -8) [0,-1, -2, -3, -4,-5, -6, -7, -8 ... [0,-1, -2, -3, -4,-5, -6, -7] Select the correct answer from above options...
asked Dec 28, 2021 in Education by JackTerrance
0 votes
    Expand the abbreviations. 1. SAARC 2. ASEAN 3. OPEC 4. NIEO 5. NAFTA 6. OAS 7. WTO Select the correct answer from above options...
asked Aug 3, 2022 in Education by JackTerrance
0 votes
    _____________ will produce a sequential vector c( (1,2,3,4,5,6,7,8,9)). (a) Seq(9) (b) Seq ... Functions and Debugging of R Programming Select the correct answer from above options...
asked Feb 13, 2022 in Education by JackTerrance
...