WPM bersih0
WPM0
Ketepatan100%
Lupa Lenyap0s
Waktu—
Aksara mata rantai0
koreksi0
Ralat0
Kemajuan Internet0%
Nama Caps Lock On
Panduan petunjuk kode baca code code code code lema
- Bahasa Pemrograman Bahasa
- Java
- Kesulitan Liar
- SederhanaCity in Argentina
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);
}
}