Here you can find the source of subtract(Vector
public static Vector<BigDecimal> subtract(Vector<BigDecimal> a, Vector<BigDecimal> b)
//package com.java2s; //License from project: Open Source License import java.math.BigDecimal; import java.util.Vector; public class Main { public static Vector<BigDecimal> subtract(Vector<BigDecimal> a, Vector<BigDecimal> b) { int m = a.size(); Vector<BigDecimal> c = new Vector(m); for (int i = 0; i < m; i++) { BigDecimal value = ((BigDecimal) a.elementAt(i)).subtract((BigDecimal) b.elementAt(i)); c.add(value);/*from www . j a va2 s . c om*/ } return c; } /*** ***/ // TODO: write vector class that incorporates most vector operations public static Vector<BigDecimal> add(Vector<BigDecimal> a, Vector<BigDecimal> b) { int m = a.size(); Vector<BigDecimal> c = new Vector(m); for (int i = 0; i < m; i++) { BigDecimal value = ((BigDecimal) a.elementAt(i)).add((BigDecimal) b.elementAt(i)); c.add(value); } return c; } }