నికర WPM0
WPM0
ఖచ్చితత్వం100%
గడిచింది0s
సమయం—
అక్షరాలు0
తప్పు0
లోపాలు0
ప్రగతి0%

Shift + Enter · ప్రారంభించండి / పునఃప్రారంభించండి

కోడ్ ప్రాంప్ట్ గైడ్‌ని చదవండి
ప్రోగ్రామింగ్ లాంగ్వేజ్
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);
    }
}