获取长值列表的总数
//package com.nowjava; /**来自 时 代 J a v a**/ import java.util.List; public class Main { public static long getTotal(List<Long> times) { long total = 0; for (Long time : times) { total = total + time; } return total; } }
//package com.nowjava; /**来自 时 代 J a v a**/ import java.util.List; public class Main { public static long getTotal(List<Long> times) { long total = 0; for (Long time : times) { total = total + time; } return total; } }