Notice: This page requires JavaScript to function properly.
Please enable JavaScript in your browser settings or update your browser.
Вивчайте Challenge: Autoboxing in Collections | Type Conversion and Wrapper Classes
Java Data Types

bookChallenge: Autoboxing in Collections

Завдання

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

solution.java

Все було зрозуміло?

Як ми можемо покращити це?

Дякуємо за ваш відгук!

Секція 3. Розділ 5
single

single

Запитати АІ

expand

Запитати АІ

ChatGPT

Запитайте про що завгодно або спробуйте одне із запропонованих запитань, щоб почати наш чат

close

Awesome!

Completion rate improved to 7.14

bookChallenge: Autoboxing in Collections

Свайпніть щоб показати меню

Завдання

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

solution.java

Switch to desktopПерейдіть на комп'ютер для реальної практикиПродовжуйте з того місця, де ви зупинились, використовуючи один з наведених нижче варіантів
Все було зрозуміло?

Як ми можемо покращити це?

Дякуємо за ваш відгук!

Секція 3. Розділ 5
single

single

some-alt