Here you can find the source of sumVector(ArrayList
public static ArrayList<Double> sumVector(ArrayList<Double> v1, ArrayList<Double> v2)
//package com.java2s; //License from project: Apache License import java.util.ArrayList; public class Main { public static ArrayList<Double> sumVector(ArrayList<Double> v1, ArrayList<Double> v2) { ArrayList<Double> sumV = new ArrayList<Double>(); for (int i = 0; i < v1.size(); i++) { sumV.add(v1.get(i) + v2.get(i)); }//w w w . j av a2 s .c om return sumV; } }