Challenge: Autoboxing in Collections
Taak
Swipe to start coding
Implement a method that calculates and returns the average value of all elements in the provided ArrayList
- Complete the method so it uses a loop to sum all values in the input list.
- Calculate the average as a double and return it from the method.
- In the main method, call your method and print the result using this template:
Average value: {average}.
Oplossing
solution.java
Was alles duidelijk?
Bedankt voor je feedback!
Sectie 3. Hoofdstuk 5
single
Vraag AI
Vraag AI
Vraag wat u wilt of probeer een van de voorgestelde vragen om onze chat te starten.
Awesome!
Completion rate improved to 7.14
Challenge: Autoboxing in Collections
Veeg om het menu te tonen
Taak
Swipe to start coding
Implement a method that calculates and returns the average value of all elements in the provided ArrayList
- Complete the method so it uses a loop to sum all values in the input list.
- Calculate the average as a double and return it from the method.
- In the main method, call your method and print the result using this template:
Average value: {average}.
Oplossing
solution.java
Was alles duidelijk?
Bedankt voor je feedback!
Sectie 3. Hoofdstuk 5
single