WPM0
WPM0
דיוק100%
נפילה0s
זמן הזמן—
דמויות0
תיקון0
טעויות0
התקדמות התקדמות0%
Caps Lock פעיל

תגית: Code Direct Guide

תכנות שפה
Java
קושי
בינוני בינוני בינוני

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);
    }
}