import java.util.*; public class TypeSafe { public static void main(String[] args) { List numbers = new ArrayList(); numbers.add("1"); numbers.add(2); numbers.add("3"); int total = 0; for(String number: numbers) { total += Integer.parseInt(number); } System.out.println("total = " + total); } }