نیٹ ورکM0
ڈبلیو ایم0
درستگی100%
ای میل0s
وقت—
حروف0
غیر متصل0
خامی0
ترقی0%
کپاس لاک آن

کو ڈِک نیٹ ورک کو معطل کریں

غیر متصل زبان
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);
    }
}