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

bookChallenge: Autoboxing in Collections

Aufgabe

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

Lösung

solution.java

solution.java

War alles klar?

Wie können wir es verbessern?

Danke für Ihr Feedback!

Abschnitt 3. Kapitel 5
single

single

Fragen Sie AI

expand

Fragen Sie AI

ChatGPT

Fragen Sie alles oder probieren Sie eine der vorgeschlagenen Fragen, um unser Gespräch zu beginnen

close

Awesome!

Completion rate improved to 7.14

bookChallenge: Autoboxing in Collections

Swipe um das Menü anzuzeigen

Aufgabe

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

Lösung

solution.java

solution.java

Switch to desktopWechseln Sie zum Desktop, um in der realen Welt zu übenFahren Sie dort fort, wo Sie sind, indem Sie eine der folgenden Optionen verwenden
War alles klar?

Wie können wir es verbessern?

Danke für Ihr Feedback!

Abschnitt 3. Kapitel 5
single

single

some-alt