WPM netto0
WPM0
Precisione100%
Trascorso0s
Tempo—
Caratteri0
Errato0
Errori0
Progressi0%
Leggi la guida al test di codice
Linguaggio di programmazione
Java
Difficoltà
Medio

Traverse a list and calculate its total.

import java.util.List;

public class Main {
    public static void main(String[] args) {
        List<Integer> values = List.of(4, 8, 15, 16);
        int total = 0;

        for (int value : values) {
            total += value;
        }

        System.out.println(total);
    }
}