નેટ WPM0
WPM0
ચોક્કસતા100%
વિતી ગયેલ0s
સમય—
અક્ષરો0
ખોટો0
ભૂલો0
પ્રગતિ0%

Shift + Enter · Start / restart

કોડ પ્રોમ્પ્ટ માર્ગદર્શિકા વાંચો
પ્રોગ્રામિંગ ભાષા
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);
    }
}