Notice: This page requires JavaScript to function properly.
Please enable JavaScript in your browser settings or update your browser.
Apprendre Challenge: Autoboxing in Collections | Type Conversion and Wrapper Classes
Java Data Types

bookChallenge: Autoboxing in Collections

Tâche

Swipe to start coding

Implement a method that calculates and returns the average value of all elements in the provided ArrayList as a double.

  • 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}.

Solution

solution.java

solution.java

Tout était clair ?

Comment pouvons-nous l'améliorer ?

Merci pour vos commentaires !

Section 3. Chapitre 5
single

single

Demandez à l'IA

expand

Demandez à l'IA

ChatGPT

Posez n'importe quelle question ou essayez l'une des questions suggérées pour commencer notre discussion

close

Awesome!

Completion rate improved to 7.14

bookChallenge: Autoboxing in Collections

Glissez pour afficher le menu

Tâche

Swipe to start coding

Implement a method that calculates and returns the average value of all elements in the provided ArrayList as a double.

  • 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}.

Solution

solution.java

solution.java

Switch to desktopPassez à un bureau pour une pratique réelleContinuez d'où vous êtes en utilisant l'une des options ci-dessous
Tout était clair ?

Comment pouvons-nous l'améliorer ?

Merci pour vos commentaires !

Section 3. Chapitre 5
single

single

some-alt